From c4ac9da3e59530ada1d185aa921bcc89d73823af Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Tue, 12 Aug 2025 13:32:27 +0800 Subject: [PATCH] =?UTF-8?q?update:=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-apk.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index 85328e94..8c81bdd9 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -33,12 +33,17 @@ jobs: uses: actions/setup-node@v4 with: node-version: '18' - cache: 'npm' + cache: 'pnpm' + cache-dependency-path: 'main/manager-mobile/pnpm-lock.yaml' - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 10.10.0 + run_install: false + store_dir: ~/.pnpm-store + env: + PNPM_HOME: ~/.pnpm-store - name: Extract version from tag or input id: get_version @@ -67,7 +72,9 @@ jobs: - name: Install dependencies run: | cd main/manager-mobile - pnpm install + pnpm install --frozen-lockfile + env: + PNPM_HOME: ~/.pnpm-store - name: Build Android APK run: | @@ -75,6 +82,7 @@ jobs: pnpm build:app-android env: NODE_ENV: production + PNPM_HOME: ~/.pnpm-store - name: Find APK file id: find_apk @@ -91,13 +99,13 @@ jobs: fi - name: Create Release (only for version tags or manual with create_release=true) - if: env.IS_VERSION == 'true' + if: env.IS_VERSION == 'true' && env.BUILD_TYPE == 'tag' id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ env.BUILD_TYPE == 'tag' && github.ref || format('v{0}', env.VERSION) }} + tag_name: ${{ github.ref }} release_name: Release ${{ env.VERSION }} body: | ## What's Changed @@ -118,7 +126,7 @@ jobs: prerelease: ${{ env.BUILD_TYPE == 'manual' }} - name: Upload APK to Release - if: steps.create_release.outputs.upload_url != '' && env.APK_FOUND == 'true' + if: steps.create_release.outputs.upload_url != '' && env.APK_FOUND == 'true' && env.BUILD_TYPE == 'tag' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}