From e5dcbabed59b2183cce018def6cf641729b0d06e Mon Sep 17 00:00:00 2001 From: emi~ Date: Sun, 12 Nov 2023 21:52:36 -0300 Subject: [PATCH] ci: make two releases per push --- .github/workflows/main.yml | 42 +++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc66210..48e39f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,35 +4,49 @@ on: push: branches: - "master" - - "standalone" + - "standalone" workflow_dispatch: jobs: pre-release: - name: "Pre Release" + name: "Release" runs-on: ubuntu-latest - strategy: - matrix: - branch: [master, standalone] steps: - - uses: actions/checkout@v3 + - name: "Checkout Master Branch" + uses: actions/checkout@v3 with: - ref: ${{ matrix.branch }} + ref: 'master' + + - name: "Extract Master Version Code" + run: | + VERSION_CODE=$(grep 'version=' module.prop | cut -d'=' -f2) + echo "MASTER_VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV - - name: "Extract Version Code" - id: version_code + - name: "Build Master" run: | - VERSION_CODE=$(grep 'versionCode=' module.prop | cut -d'=' -f2) - echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV - echo "versionCode=$VERSION_CODE" >> $GITHUB_ENV + sh ./build.sh github + mv *.zip "eMagisk-full-${{ env.MASTER_VERSION_CODE }}.zip" + + - name: "Checkout Standalone Branch" + uses: actions/checkout@v3 + with: + ref: 'standalone' - - name: "Build" + - name: "Extract Standalone Version Code" + run: | + VERSION_CODE=$(grep 'version=' module.prop | cut -d'=' -f2) + echo "STANDALONE_VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV + + - name: "Build Standalone" run: | sh ./build.sh github + mv *.zip "eMagisk-noatlas-${{ env.STANDALONE_VERSION_CODE }}.zip" + - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "${{ matrix.branch }}-${{ env.versionCode }}" + automatic_release_tag: "release-v${{ env.MASTER_VERSION_CODE }}-v${{ env.STANDALONE_VERSION_CODE }}" prerelease: true + title: "Combined Release v${{ env.MASTER_VERSION_CODE }} & v${{ env.STANDALONE_VERSION_CODE }}" files: | *.zip