Skip to content

Commit fcd8aa0

Browse files
committed
Update GitHub Actions to latest versions and improve release workflow
Upgraded actions/checkout, actions/cache, and game-ci/unity-builder to v4 in build and package workflows. Updated release workflow to use softprops/action-gh-release for creating releases and uploading assets, replaced deprecated set-output commands with GITHUB_OUTPUT, and set explicit permissions. Also updated github-push-action to a tagged version for improved reliability.
1 parent 530d3b8 commit fcd8aa0

File tree

3 files changed

+21
-27
lines changed

3 files changed

+21
-27
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ jobs:
2424
steps:
2525
# Checkout
2626
- name: Checkout
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
3030
lfs: true
3131

3232
# Cache
3333
- name: Cache
34-
uses: actions/cache@v2
34+
uses: actions/cache@v4
3535
with:
3636
path: Library
3737
key: Library-${{ matrix.targetPlatform }}
3838
restore-keys: Library-
3939

4040
# Build
4141
- name: Build
42-
uses: game-ci/unity-builder@v2
42+
uses: game-ci/unity-builder@v4
4343
env:
4444
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_2020 }}
4545
with:
46-
targetPlatform: ${{ matrix.targetPlatform }}
46+
targetPlatform: ${{ matrix.targetPlatform }}

.github/workflows/package.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
# Cache
2222
- name: Cache
23-
uses: actions/cache@v2
23+
uses: actions/cache@v4
2424
with:
2525
path: Library
2626
key: Library
@@ -42,4 +42,4 @@ jobs:
4242
uses: actions/upload-artifact@v4
4343
with:
4444
name: Unity Package
45-
path: Build
45+
path: Build

.github/workflows/release.yaml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99

1010
env:
1111
GIT_TAG: ${{ github.event.inputs.tag }}
12+
permissions:
13+
contents: write
1214

1315
jobs:
1416
update-packagejson:
@@ -29,7 +31,9 @@ jobs:
2931
id: check_update
3032
run: |
3133
cat ${{ env.TARGET_FILE}}
32-
git diff --exit-code || echo "::set-output name=changed::1"
34+
if ! git diff --exit-code; then
35+
echo "changed=1" >> "$GITHUB_OUTPUT"
36+
fi
3337
3438
- name: Commit files
3539
id: commit
@@ -38,7 +42,7 @@ jobs:
3842
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
3943
git config --local user.name "github-actions[bot]"
4044
git commit -m "feat: Update package.json to ${{ env.GIT_TAG }}" -a
41-
echo "::set-output name=sha::$(git rev-parse HEAD)"
45+
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
4246
4347
- name: Check sha
4448
run: echo "SHA ${SHA}"
@@ -51,7 +55,7 @@ jobs:
5155

5256
- name: Push changes
5357
if: steps.check_update.outputs.changed == '1'
54-
uses: ad-m/github-push-action@master
58+
uses: ad-m/github-push-action@v0.6.0
5559
with:
5660
github_token: ${{ secrets.GITHUB_TOKEN }}
5761
branch: ${{ github.ref }}
@@ -106,27 +110,17 @@ jobs:
106110
needs: [update-packagejson, build]
107111
runs-on: ubuntu-latest
108112
steps:
109-
# Create Releases
110-
- uses: actions/create-release@v1
111-
id: create_release
112-
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114-
with:
115-
tag_name: ${{ env.GIT_TAG }}
116-
release_name: ${{ env.GIT_TAG }}
117-
commitish: ${{ needs.update-packagejson.outputs.sha }}
118-
draft: true
119-
prerelease: false
120-
121113
# Download(All) Artifacts to current directory
122114
- uses: actions/download-artifact@v4
123115

124-
# Upload to Releases(unitypackage)
125-
- uses: actions/upload-release-asset@v1
116+
# Create release and upload unitypackage.
117+
- uses: softprops/action-gh-release@v1
126118
env:
127119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128120
with:
129-
upload_url: ${{ steps.create_release.outputs.upload_url }}
130-
asset_path: ./SerializeReference-Extensions.unitypackage/SerializeReference-Extensions.unitypackage
131-
asset_name: SerializeReference-Extensions.unitypackage
132-
asset_content_type: application/octet-stream
121+
tag_name: ${{ env.GIT_TAG }}
122+
name: ${{ env.GIT_TAG }}
123+
target_commitish: ${{ needs.update-packagejson.outputs.sha }}
124+
draft: true
125+
prerelease: false
126+
files: SerializeReference-Extensions.unitypackage/SerializeReference-Extensions.unitypackage

0 commit comments

Comments
 (0)