Files
TuffXPlus-Unshittified/.github/workflows/gradle.yml
T

77 lines
2.0 KiB
YAML

name: Gradle Build
on:
push:
branches: [ "main" ]
paths-ignore:
- "builds/**"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]'
steps:
- name: Generate Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.TUFF_BUILDER_ID }}
private-key: ${{ secrets.TUFF_BUILDER_PRIVATE_KEY }}
- name: checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: setup
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: permissions
run: chmod +x gradlew
- name: build
run: ./gradlew --no-daemon build
- name: copy jar to builds
run: |
mkdir -p builds
cp build/libs/*.jar builds/
- name: push jar
run: |
git config --global user.name "${{ steps.generate-token.outputs.app-slug }}[bot]"
git config --global user.email "${{ secrets.TUFF_BUILDER_ID }}+${{ steps.generate-token.outputs.app-slug }}[bot]@users.noreply.github.com"
git add builds/
if git diff --cached --quiet; then
echo "No build artifact changes to commit."
exit 0
fi
git commit -m "Update build artifact"
git push
- name: Deploy to Testers Repo
env:
TOKEN: ${{ secrets.VERSION_REPO_TOKEN }}
run: |
git clone https://x-access-token:${TOKEN}@github.com/tuffnetwork/testers.git deploy_repo
cd deploy_repo
git config user.name "github-actions"
git config user.email "actions@github.com"
mkdir -p plugin-builds
cp -r ../builds/* "plugin-builds/"
git add .
git commit -m "Upload build wowowow" || echo "No changes"
git push