From 1dbf265a9a48392fe3d09c8b21469f9c69b35d99 Mon Sep 17 00:00:00 2001 From: Lily Date: Sun, 15 Sep 2024 11:57:17 +0300 Subject: [PATCH] Update mobile-release.yml --- .github/workflows/mobile-release.yml | 71 +++++++++++++++++----------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/.github/workflows/mobile-release.yml b/.github/workflows/mobile-release.yml index a5229103221..d35211433d8 100644 --- a/.github/workflows/mobile-release.yml +++ b/.github/workflows/mobile-release.yml @@ -3,7 +3,22 @@ name: Mobile Release on: workflow_dispatch: +permissions: + contents: write + jobs: + get-latest-tag: + runs-on: ubuntu-latest + outputs: + latest_tag: ${{ steps.get_tag.outputs.LATEST_TAG }} + steps: + - name: Get latest release tag + id: get_tag + run: | + latest_tag=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name) + echo "Latest tag is $latest_tag" + echo "::set-output name=LATEST_TAG::$latest_tag" + build: name: Build uses: ./.github/workflows/mobile.yml @@ -12,38 +27,38 @@ jobs: release-android: name: Release androidBuild - needs: build + needs: [get-latest-tag, build] runs-on: ubuntu-latest steps: - - name: Download Android artifact - uses: actions/download-artifact@main - with: - name: androidBuild - - name: Upload androidBuild to release - uses: svenstaro/upload-release-action@2.5.0 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ github.ref_name }} - file: JSEngine-release.apk - asset_name: FNF-JS-Engine-android.apk - overwrite: false + - name: Download Android artifact + uses: actions/download-artifact@main + with: + name: androidBuild + - name: Upload androidBuild to release + uses: svenstaro/upload-release-action@2.5.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ needs.get-latest-tag.outputs.latest_tag }} + file: JSEngine-release.apk + asset_name: FNF-JS-Engine-android.apk + overwrite: false release-ios: name: Release iOSBuild - needs: build + needs: [get-latest-tag, build] runs-on: ubuntu-latest steps: - - name: Download iOS artifact - uses: actions/download-artifact@main - with: - name: iOSBuild - - name: Zip For Release - run: zip -r JSEngine-iOS.zip JSEngine.ipa - - name: Upload androidBuild to release - uses: svenstaro/upload-release-action@2.5.0 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ github.ref_name }} - file: JSEngine-iOS.zip - asset_name: FNF-JS-Engine-ios.zip - overwrite: false + - name: Download iOS artifact + uses: actions/download-artifact@main + with: + name: iOSBuild + - name: Zip For Release + run: zip -r JSEngine-iOS.zip JSEngine.ipa + - name: Upload iOSBuild to release + uses: svenstaro/upload-release-action@2.5.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ needs.get-latest-tag.outputs.latest_tag }} + file: JSEngine-iOS.zip + asset_name: FNF-JS-Engine-ios.zip + overwrite: false