Skip to content

Commit 1ab7696

Browse files
committed
upgrade deprecated GitHub Actions to latest versions
- actions/checkout v2 → v4 - actions/setup-java v1 → v4 with temurin distribution - actions/upload-artifact v1 → v4 - replace archived create-release and upload-release-asset with softprops/action-gh-release v2 - migrate deprecated ::set-output to $GITHUB_OUTPUT
1 parent a3bb309 commit 1ab7696

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

.github/workflows/build_apk.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,25 @@ jobs:
3131

3232
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3333
- name: checkout codes
34-
uses: actions/checkout@v2
34+
uses: actions/checkout@v4
3535
with:
36-
fetch-depth: '0' # 0 indicates all history, this is needed for git revision
36+
fetch-depth: '0' # 0 indicates all history, this is needed for git revision
3737

3838
- name: Set up JDK
39-
uses: actions/setup-java@v1
39+
uses: actions/setup-java@v4
4040
with:
41+
distribution: 'temurin'
4142
java-version: '11'
4243

4344
- name: Assemble Release APK
4445
run: ./gradlew assembleRelease --stacktrace
45-
46+
4647
- name: Upload APK to artifacts
47-
uses: actions/upload-artifact@v1
48+
uses: actions/upload-artifact@v4
4849
with:
4950
name: TouchHelper
5051
path: ./app/build/outputs/apk/
51-
52+
5253
- name: Create ZIPs
5354
working-directory: ./app/build/outputs/apk/
5455
run: |
@@ -57,27 +58,16 @@ jobs:
5758
- name: Get git revision
5859
id: get_git_revision
5960
run: |
60-
echo "::set-output name=tag_name::$(($(git rev-list HEAD --count) + 100))"
61-
echo "::set-output name=release_name::$(($(git rev-list HEAD --count) + 100))"
61+
echo "tag_name=$(($(git rev-list HEAD --count) + 100))" >> $GITHUB_OUTPUT
62+
echo "release_name=$(($(git rev-list HEAD --count) + 100))" >> $GITHUB_OUTPUT
6263
63-
- name: Create Release
64-
id: create_release
65-
uses: actions/create-release@v1
64+
- name: Create Release and Upload APK
65+
uses: softprops/action-gh-release@v2
6666
env:
6767
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6868
with:
6969
tag_name: tag-${{ steps.get_git_revision.outputs.tag_name }}
70-
release_name: Release ${{ steps.get_git_revision.outputs.release_name }}
70+
name: Release ${{ steps.get_git_revision.outputs.release_name }}
7171
draft: false
7272
prerelease: false
73-
74-
- name: Upload Release APK
75-
id: upload-release-asset-images
76-
uses: actions/upload-release-asset@v1
77-
env:
78-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
with:
80-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
81-
asset_path: ./app/build/outputs/apk/TouchHelper.zip
82-
asset_name: TouchHelper.zip
83-
asset_content_type: application/zip
73+
files: ./app/build/outputs/apk/TouchHelper.zip

0 commit comments

Comments
 (0)