Update commitTest.yml #397
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 Mod | |
on: [ push, pull_request ] | |
jobs: | |
buildJar: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up PATH | |
run: | | |
echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Build mod jar | |
run: ./gradlew deploy | |
- name: Upload built jar file | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: build/libs/${{ github.event.repository.name }}.jar | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Sync bundles | |
env: | |
BAIDU_APP_ID: ${{ secrets.BAIDU_APP_ID }} | |
BAIDU_KEY: ${{ secrets.BAIDU_KEY }} | |
run: | | |
./gradlew syncBundle | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --global user.name "Github Actions" | |
git add ./assets/bundles/* | |
git commit -m "Automatic bundle update" | |
git push | |
fi |