From 46cd18352835d2ab1a417c943afa44d35414b6c6 Mon Sep 17 00:00:00 2001 From: Zaw <42999156+ImZaw@users.noreply.github.com> Date: Tue, 16 Aug 2022 23:10:45 +0300 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1704105 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +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: + # choose your default branch + - master + # - main + paths-ignore: + - '*.md' + +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 || true + + - name: Setup JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - 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 "actions@github.com" + 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