diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index f1c98aa..b38e939 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -35,7 +35,7 @@ jobs: uses: android-actions/setup-android@v3 - name: Cache Gradle dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -119,14 +119,16 @@ jobs: echo "Module contents:" unzip -l zygisk-myinjector-$VERSION.zip + # 重命名 APK 以包含版本号 + cp configapp/build/outputs/apk/debug/configapp-debug.apk ./ConfigApp-$VERSION.apk + - name: Create Release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: + token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ github.event_name == 'push' && github.ref || github.event.inputs.version }} - release_name: Release ${{ github.event_name == 'push' && github.ref || github.event.inputs.version }} + name: Release ${{ github.event_name == 'push' && github.ref || github.event.inputs.version }} body: | ## Zygisk MyInjector Release @@ -146,33 +148,6 @@ jobs: 请查看 [commits](https://github.com/${{ github.repository }}/commits/${{ github.sha }}) draft: false prerelease: false - - - name: Get version for upload - id: get_version - run: | - if [ "${{ github.event_name }}" == "push" ]; then - VERSION="${GITHUB_REF#refs/tags/}" - else - VERSION="${{ github.event.inputs.version }}" - fi - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - - - name: Upload Module - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./zygisk-myinjector-${{ steps.get_version.outputs.VERSION }}.zip - asset_name: zygisk-myinjector-${{ steps.get_version.outputs.VERSION }}.zip - asset_content_type: application/zip - - - name: Upload ConfigApp APK - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./configapp/build/outputs/apk/debug/configapp-debug.apk - asset_name: ConfigApp-${{ steps.get_version.outputs.VERSION }}.apk - asset_content_type: application/vnd.android.package-archive \ No newline at end of file + files: | + ./zygisk-myinjector-*.zip + ./ConfigApp-*.apk \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e7b22d..2328b4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: uses: android-actions/setup-android@v3 - name: Cache Gradle dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -104,13 +104,15 @@ jobs: unzip -l zygisk-myinjector-ci.zip - name: Upload Module Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: module-ci-${{ github.sha }} path: zygisk-myinjector-ci.zip + retention-days: 7 - name: Upload ConfigApp Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: configapp-ci-${{ github.sha }} - path: configapp/build/outputs/apk/debug/configapp-debug.apk \ No newline at end of file + path: configapp/build/outputs/apk/debug/configapp-debug.apk + retention-days: 7 \ No newline at end of file