fix: update action to v4

This commit is contained in:
jiqiu2021
2025-06-25 22:11:37 +08:00
parent ce7ef53ac5
commit 4af96025cb
2 changed files with 16 additions and 39 deletions

View File

@@ -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
files: |
./zygisk-myinjector-*.zip
./ConfigApp-*.apk

View File

@@ -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
path: configapp/build/outputs/apk/debug/configapp-debug.apk
retention-days: 7