inb4 this breaks all my plugins #196
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: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '*.md' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
path: "src" | |
- name: Checkout builds | |
uses: actions/checkout@master | |
with: | |
ref: "builds" | |
path: "builds" | |
- name: Setup JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 11 | |
distribution: zulu | |
cache: gradle | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Build Plugins | |
run: | | |
cd $GITHUB_WORKSPACE/src | |
chmod +x gradlew | |
./gradlew make generateUpdaterJson --no-daemon | |
mkdir $GITHUB_WORKSPACE/compiled | |
cp $GITHUB_WORKSPACE/src/**/build/*.zip $GITHUB_WORKSPACE/compiled | |
cp $GITHUB_WORKSPACE/src/build/updater.json $GITHUB_WORKSPACE/compiled | |
- name: Upload plugins as artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: plugins | |
path: compiled | |
- name: Push builds | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
cd $GITHUB_WORKSPACE/builds | |
cp $GITHUB_WORKSPACE/compiled/* . | |
git config --local user.email "[email protected]" | |
git config --local user.name "Your mom" | |
git add . | |
git commit -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit | |
git push | |