Horis 2 ani în urmă
părinte
comite
a156e98ee9
1 a modificat fișierele cu 28 adăugiri și 5 ștergeri
  1. 28 5
      .github/workflows/test.yml

+ 28 - 5
.github/workflows/test.yml

@@ -141,6 +141,14 @@ jobs:
           if-no-files-found: ignore
           if-no-files-found: ignore
           path: ${{ github.workspace }}/apk/*.apk
           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
       - name: Upload Mapping File To Artifact
         uses: actions/upload-artifact@v4
         uses: actions/upload-artifact@v4
         with:
         with:
@@ -148,21 +156,36 @@ jobs:
           if-no-files-found: ignore
           if-no-files-found: ignore
           path: ${{ github.workspace }}/mapping/mapping.txt
           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
       - name: Delete Pre-Release
-        if: env.type == 'release'
         run: gh release delete beta -y --cleanup-tag
         run: gh release delete beta -y --cleanup-tag
         env:
         env:
           GH_TOKEN: ${{ github.token }}
           GH_TOKEN: ${{ github.token }}
 
 
       - name: Publish Pre-Release
       - name: Publish Pre-Release
-        if: env.type == 'release'
         uses: ncipollo/release-action@v1
         uses: ncipollo/release-action@v1
         with:
         with:
-          name: legado_${{ env.product }}_${{ env.VERSION }}
+          name: legado_app_${{ env.VERSION }}
           tag: "beta"
           tag: "beta"
-          body: "此版本为测试版,可能存在不稳定情况,升级前请务必备份好数据。"
+          body: "此版本为测试版,签名与正式版不同,可能存在不稳定情况,升级前请务必备份好数据。"
           prerelease: true
           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:
   lanzou:
     needs: [ prepare, build ]
     needs: [ prepare, build ]