From d061cdb750339bfb11cb1b1e479424e036cdd0e6 Mon Sep 17 00:00:00 2001 From: Maary <24504742+Steve-Mr@users.noreply.github.com> Date: Sat, 13 May 2023 14:33:00 +0800 Subject: [PATCH] update workflow --- .github/workflows/android.yml | 299 ++++++++++++++++++++-------------- 1 file changed, 175 insertions(+), 124 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index db0ba98..45b9438 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -31,7 +31,7 @@ jobs: echo "${{ secrets.KEYSTORE }}" | base64 --decode > ./app/key.keystore ls ./app ls -l ./app/key.keystore - + - name: Storing keystore run: | echo "${{ secrets.KEYSTORE }}" | base64 --decode > ./key.keystore @@ -69,141 +69,192 @@ jobs: name: WishMeSilence-x86 path: ${{ env.APK_FILE_X86 }} -# - name: Create Release -# id: create_release -# uses: actions/create-release@v1.0.0 -# env: -# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} -# with: -# tag_name: v${{ github.run_number }} -# release_name: Release v${{ github.run_number }} -# body: | -# ## Changes -# ${{ github.event.pull_request.body }} -# ${{ steps.show_pr_commits.outputs.commits }} -# ## APKs -# - [WishMeSilence-arm64-v8a](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-arm64-v8a) -# - [WishMeSilence-armeabi-v7a](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-armeabi-v7a) -# - [WishMeSilence-x64](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-x64) -# - [WishMeSilence-x86](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-x86) - - - name: Publish Release - uses: ncipollo/release-action@v1 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: - token: ${{ secrets.GH_TOKEN }} tag_name: v${{ github.run_number }} release_name: Release v${{ github.run_number }} body: | + ## Changes ${{ github.event.pull_request.body }} ${{ steps.show_pr_commits.outputs.commits }} - artifacts: ${{ github.artifacts }} - - -# echo "::set-env name=APK_PATH::$(find app/build/outputs/apk/ -name '*.apk' -type f)" -# -# release: -# runs-on: ubuntu-latest -# needs: build -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# steps: -# # create release -# - name: Create Release -# id: create_release -# uses: actions/create-release@v1 -# with: -# tag_name: ${{ github.ref }} -# release_name: Release ${{ github.ref }} -# body: | -# This is the first release of the app. -# -# # upload apk files -# - name: Upload APK -# id: upload-release-asset +# - name: upload v8a artifact # uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ github.token }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} -# asset_path: ${{ env.APK_PATH }} -# asset_name: my-app.apk -# asset_content_type: application/vnd.android.package-archive +# asset_path: ./bin/azblogfilter.linux-amd64.tar.gz +# asset_name: azblogfilter.linux-amd64.tar.gz +# asset_content_type: application/gzip -# echo "APK_FILE=$(find app/build/outputs/apk -name '*arm64*.apk')" >> $GITHUB_ENV -# echo "APK_FILE_ARMV7=$(find app/build/outputs/apk -name '*arm32*.apk')" >> $GITHUB_ENV -# echo "APK_FILE_X86=$(find app/build/outputs/apk -name '*x86.apk')" >> $GITHUB_ENV -# echo "APK_FILE_X64=$(find app/build/outputs/apk -name '*x86_64*.apk')" >> $GITHUB_ENV -# -# - uses: actions/upload-artifact@v2 -# name: Upload apk (arm64-v8a) -# with: -# name: WishMeSilence-arm64-v8a -# path: ${{ env.APK_FILE }} -# - uses: actions/upload-artifact@v2 -# name: Upload apk (armeabi-v7a) -# with: -# name: WishMeSilence-armeabi-v7a -# path: ${{ env.APK_FILE_ARMV7 }} -# - uses: actions/upload-artifact@v2 -# name: Upload apk (x86_64) -# with: -# name: WishMeSilence-x86_64 -# path: ${{ env.APK_FILE_X64 }} -# - uses: actions/upload-artifact@v2 -# name: Upload apk (x86) -# with: -# name: WishMeSilence-x86 -# path: ${{ env.APK_FILE_X86 }} -# - name: Upload mapping -# uses: actions/upload-artifact@v3 -# with: -# name: mapping -# path: app/build/outputs/mapping -# - name: Create Release -# id: create_release -# uses: actions/create-release@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# tag_name: ${{ github.ref }} -# release_name: Release ${{ github.ref }} -# body: -# draft: false -# prerelease: false + - uses: actions/upload-release-asset@v1 + name: Upload apk (arm64-v8a) + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_name: WishMeSilence-arm64-v8a + asset_path: ${{ env.APK_FILE }} + asset_content_type: application/zip + + - uses: actions/upload-release-asset@v1 + name: Upload apk (armeabi-v7a) + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_name: WishMeSilence-armeabi-v7a + asset_path: ${{ env.APK_FILE_ARMV7 }} + asset_content_type: application/zip + + - uses: actions/upload-release-asset@v1 + name: Upload apk (x86_64) + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_name: WishMeSilence-x86_64 + asset_path: ${{ env.APK_FILE_X64 }} + asset_content_type: application/zip + + - uses: actions/upload-release-asset@v1 + name: Upload apk (x86) + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_name: WishMeSilence-x86 + asset_path: ${{ env.APK_FILE_X86 }} + asset_content_type: application/zip + + # ## APKs + # - [WishMeSilence-arm64-v8a](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-arm64-v8a) + # - [WishMeSilence-armeabi-v7a](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-armeabi-v7a) + # - [WishMeSilence-x64](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-x64) + # - [WishMeSilence-x86](${{ steps.upload_apk.outputs.artifacts_url }}/WishMeSilence-x86) + + # - name: Publish Release + # uses: ncipollo/release-action@v1 + # with: + # token: ${{ secrets.GH_TOKEN }} + # tag_name: v${{ github.run_number }} + # release_name: Release v${{ github.run_number }} + # body: | + # ${{ github.event.pull_request.body }} + # ${{ steps.show_pr_commits.outputs.commits }} + # artifacts: ${{ github.artifacts }} + + + + # echo "::set-env name=APK_PATH::$(find app/build/outputs/apk/ -name '*.apk' -type f)" + # + # release: + # runs-on: ubuntu-latest + # needs: build + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # steps: + # # create release + # - name: Create Release + # id: create_release + # uses: actions/create-release@v1 + # with: + # tag_name: ${{ github.ref }} + # release_name: Release ${{ github.ref }} + # body: | + # This is the first release of the app. + # + # # upload apk files + # - name: Upload APK + # id: upload-release-asset + # uses: actions/upload-release-asset@v1 + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ${{ env.APK_PATH }} + # asset_name: my-app.apk + # asset_content_type: application/vnd.android.package-archive + + # echo "APK_FILE=$(find app/build/outputs/apk -name '*arm64*.apk')" >> $GITHUB_ENV + # echo "APK_FILE_ARMV7=$(find app/build/outputs/apk -name '*arm32*.apk')" >> $GITHUB_ENV + # echo "APK_FILE_X86=$(find app/build/outputs/apk -name '*x86.apk')" >> $GITHUB_ENV + # echo "APK_FILE_X64=$(find app/build/outputs/apk -name '*x86_64*.apk')" >> $GITHUB_ENV + # + # - uses: actions/upload-artifact@v2 + # name: Upload apk (arm64-v8a) + # with: + # name: WishMeSilence-arm64-v8a + # path: ${{ env.APK_FILE }} + # - uses: actions/upload-artifact@v2 + # name: Upload apk (armeabi-v7a) + # with: + # name: WishMeSilence-armeabi-v7a + # path: ${{ env.APK_FILE_ARMV7 }} + # - uses: actions/upload-artifact@v2 + # name: Upload apk (x86_64) + # with: + # name: WishMeSilence-x86_64 + # path: ${{ env.APK_FILE_X64 }} + # - uses: actions/upload-artifact@v2 + # name: Upload apk (x86) + # with: + # name: WishMeSilence-x86 + # path: ${{ env.APK_FILE_X86 }} + # - name: Upload mapping + # uses: actions/upload-artifact@v3 + # with: + # name: mapping + # path: app/build/outputs/mapping + # - name: Create Release + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # tag_name: ${{ github.ref }} + # release_name: Release ${{ github.ref }} + # body: + # draft: false + # prerelease: false + + # - name: Publish Release + # if: github.event.action == 'created' + # run: | + # release_name=$(echo "${{ github.event.pull_request.title }}" | sed 's/.*#//') + # release_version=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c 1-7) + # echo "Release name: $release_name" + # echo "Release version: $release_version" + # uses: actions/create-release@v1 + # with: + # tag_name: $release_version + # release_name: $release_name + # body: "This release contains the following changes:" + # artifacts: ${{ github.artifacts }} + # release: + # name: Release APK + # needs: build + # runs-on: ubuntu-latest + # steps: + # - name: Download APK from build + # uses: actions/download-artifact@v1 + # with: + # name: WishMeSilence + # - name: Create Release + # id: create_release + # uses: softprops/action-gh-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # tag_name: v${{ github.event.inputs.version }} + # name: Release v${{ github.event.inputs.version }} + # draft: false + # prerelease: false + # files: WishMeSilence/WishMeSilence_*.apk -# - name: Publish Release -# if: github.event.action == 'created' -# run: | -# release_name=$(echo "${{ github.event.pull_request.title }}" | sed 's/.*#//') -# release_version=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c 1-7) -# echo "Release name: $release_name" -# echo "Release version: $release_version" -# uses: actions/create-release@v1 -# with: -# tag_name: $release_version -# release_name: $release_name -# body: "This release contains the following changes:" -# artifacts: ${{ github.artifacts }} -# release: -# name: Release APK -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: Download APK from build -# uses: actions/download-artifact@v1 -# with: -# name: WishMeSilence -# - name: Create Release -# id: create_release -# uses: softprops/action-gh-release@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# tag_name: v${{ github.event.inputs.version }} -# name: Release v${{ github.event.inputs.version }} -# draft: false -# prerelease: false -# files: WishMeSilence/WishMeSilence_*.apk - # upload: # name: Upload Release