Skip to content

Commit eb01185

Browse files
authored
Upgrade GitHub Actions to version 4
Updated GitHub Actions to use version 4 of various actions for checkout, setup-go, upload-artifact, and download-artifact.
1 parent 988e958 commit eb01185

1 file changed

Lines changed: 22 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ jobs:
2929

3030
steps:
3131
- name: Checkout repository
32-
uses: actions/checkout@v6
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
3335

3436
- name: Set up Go
35-
uses: actions/setup-go@v6
37+
uses: actions/setup-go@v4
3638
with:
3739
go-version: '1.23'
3840

@@ -72,7 +74,7 @@ jobs:
7274
go build -v -o $output
7375
7476
- name: Upload artifacts
75-
uses: actions/upload-artifact@v6
77+
uses: actions/upload-artifact@v4
7678
with:
7779
name: webview_go-${{ matrix.goos }}-${{ matrix.goarch }}
7880
path: dist/webview_go-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }}
@@ -82,12 +84,16 @@ jobs:
8284
runs-on: ubuntu-latest
8385
steps:
8486
- name: Checkout repository
85-
uses: actions/checkout@v6
87+
uses: actions/checkout@v4
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Fetch all tags
92+
run: git fetch --tags --force
8693

8794
- name: Generate next tag and title
8895
id: tagger
8996
run: |
90-
git fetch --tags
9197
latest=$(git tag | grep '^continuous-' | sort -V | tail -n1)
9298
if [ -z "$latest" ]; then
9399
next_tag="continuous-1"
@@ -97,13 +103,8 @@ jobs:
97103
sub=$(echo "$latest" | sed 's/^continuous-//' | cut -s -d. -f2)
98104
if [ -z "$sub" ]; then
99105
num=$((base + 1))
100-
if [ "$num" -gt 1000 ]; then
101-
next_tag="continuous-1.1"
102-
title="1.1 Continuous Build"
103-
else
104-
next_tag="continuous-$num"
105-
title="$num Continuous Build"
106-
fi
106+
next_tag="continuous-$num"
107+
title="$num Continuous Build"
107108
else
108109
major=$base
109110
minor=$((sub + 1))
@@ -113,13 +114,19 @@ jobs:
113114
fi
114115
echo "next_tag=$next_tag" >> $GITHUB_OUTPUT
115116
echo "release_title=$title" >> $GITHUB_OUTPUT
117+
git tag -f "$next_tag"
118+
119+
- name: Configure git for pushing
120+
run: |
116121
git config user.name "github-actions"
117122
git config user.email "github-actions@github.com"
118-
git tag -f "$next_tag"
119-
git push origin --force "refs/tags/$next_tag"
123+
git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}
124+
125+
- name: Push new tag
126+
run: git push origin ${{ steps.tagger.outputs.next_tag }} --force
120127

121128
- name: Download artifacts
122-
uses: actions/download-artifact@v7
129+
uses: actions/download-artifact@v4
123130
with:
124131
path: ./dist
125132

@@ -137,5 +144,3 @@ jobs:
137144
files: ./dist/**
138145
env:
139146
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
140-
141-

0 commit comments

Comments
 (0)