Update build.yml #148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency | |
concurrency: | |
group: "build" | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: # Allows manual triggering | |
push: | |
branches: | |
# choose your default branch | |
- master | |
- main | |
paths-ignore: | |
- '*.md' | |
- '*.png' | |
workflow_run: | |
workflows: | |
- Update URLS | |
types: | |
- success # Trigger only if the Update URLS workflow was successful | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
path: "src" | |
- name: Checkout builds | |
uses: actions/checkout@master | |
with: | |
ref: "builds" | |
path: "builds" | |
- name: Clean old builds | |
run: rm $GITHUB_WORKSPACE/builds/*.cs3 | |
- name: Setup Java 17 | |
uses: actions/[email protected] | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: Build Plugins | |
run: | | |
cd $GITHUB_WORKSPACE/src | |
chmod +x gradlew | |
./gradlew make makePluginsJson | |
cp **/build/*.cs3 $GITHUB_WORKSPACE/builds | |
cp build/plugins.json $GITHUB_WORKSPACE/builds | |
- name: Push builds | |
run: | | |
cd $GITHUB_WORKSPACE/builds | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit --amend -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit | |
git push --force |