diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22edd5202..a031002bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,6 +141,14 @@ jobs: if-no-files-found: ignore path: ${{ github.workspace }}/apk/*.apk + - name: Upload App To Artifact For Pre-Release + if: env.type == 'release' + uses: actions/upload-artifact@v4 + with: + name: legado.prerelease + if-no-files-found: ignore + path: ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk + - name: Upload Mapping File To Artifact uses: actions/upload-artifact@v4 with: @@ -148,21 +156,36 @@ jobs: if-no-files-found: ignore path: ${{ github.workspace }}/mapping/mapping.txt + prerelease: + needs: [ prepare, build ] + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + env: + VERSION: ${{ needs.prepare.outputs.version }} + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: legado.prerelease + path: ${{ github.workspace }}/prerelease/ + - name: Delete Pre-Release - if: env.type == 'release' run: gh release delete beta -y --cleanup-tag env: GH_TOKEN: ${{ github.token }} - name: Publish Pre-Release - if: env.type == 'release' uses: ncipollo/release-action@v1 with: - name: legado_${{ env.product }}_${{ env.VERSION }} + name: legado_app_${{ env.VERSION }} tag: "beta" - body: "此版本为测试版,可能存在不稳定情况,升级前请务必备份好数据。" + body: "此版本为测试版,签名与正式版不同,可能存在不稳定情况,升级前请务必备份好数据。" prerelease: true - artifacts: ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk + artifacts: ${{ github.workspace }}/prerelease/*.apk + + - uses: geekyeggo/delete-artifact@v5 + with: + name: legado.prerelease lanzou: needs: [ prepare, build ]