Skip to content

Commit bcc0b51

Browse files
authored
Merge pull request #4775 from harmony-one/dev
v2024.3.1 - [ci] upgrade github actions and merge artifacts
2 parents 44b464c + 8ba758a commit bcc0b51

File tree

3 files changed

+61
-43
lines changed

3 files changed

+61
-43
lines changed

.github/workflows/build-docker-proto-image.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99

1010
steps:
1111
- name: Checkout harmony core code
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
with:
1414
path: harmony
1515
ref: ${{ github.ref }}
1616
fetch-depth: 0
1717

1818
- name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v2
19+
uses: docker/setup-buildx-action@v3
2020

2121
- name: Login to DockerHub
2222
uses: docker/login-action@v2
@@ -25,7 +25,7 @@ jobs:
2525
password: ${{ secrets.DOCKER_PASSWORD }}
2626

2727
- name: Build and push
28-
uses: docker/build-push-action@v3
28+
uses: docker/build-push-action@v6
2929
with:
3030
context: ./harmony/api/service/legacysync/downloader
3131
file: ./harmony/api/service/legacysync/downloader/Proto.Dockerfile

.github/workflows/ci-tag.yaml

+29-20
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- name: Checkout harmony core code
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
with:
2222
path: harmony
2323
ref: ${{ github.event.inputs.tag }}
@@ -29,9 +29,9 @@ jobs:
2929
VERSION=$(git tag -l --sort=-v:refname | head -n 1)
3030
if git rev-parse $VERSION^{tag} -- &>/dev/null
3131
then
32-
echo "::set-output name=tag_annotated::true"
32+
echo "tag_annotated=true" >> $GITHUB_OUTPUT
3333
else
34-
echo "::set-output name=tag_annotated::false"
34+
echo "tag_annotated=false" >> $GITHUB_OUTPUT
3535
fi
3636
working-directory: harmony
3737

@@ -47,32 +47,32 @@ jobs:
4747
steps:
4848
- name: Import GPG key
4949
if: join(matrix.os, '-') != 'self-hosted-linux-ARM64'
50-
uses: crazy-max/ghaction-import-gpg@v5
50+
uses: crazy-max/ghaction-import-gpg@v6
5151
with:
5252
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
5353
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASS }}
5454

5555
- name: Checkout dependence repo
56-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5757
with:
5858
repository: harmony-one/mcl
5959
path: mcl
6060

6161
- name: Checkout dependence repo
62-
uses: actions/checkout@v3
62+
uses: actions/checkout@v4
6363
with:
6464
repository: harmony-one/bls
6565
path: bls
6666

6767
- name: Checkout harmony core code
68-
uses: actions/checkout@v3
68+
uses: actions/checkout@v4
6969
with:
7070
path: harmony
7171
ref: ${{ github.event.inputs.tag }}
7272
fetch-depth: 0
7373

7474
- name: Set up Go go.mod
75-
uses: actions/setup-go@v3
75+
uses: actions/setup-go@v5
7676
with:
7777
go-version-file: 'harmony/go.mod'
7878

@@ -117,21 +117,30 @@ jobs:
117117
working-directory: harmony
118118

119119
- name: Upload artifact
120-
uses: actions/upload-artifact@v2
120+
uses: actions/upload-artifact@v4
121121
with:
122-
name: harmony
122+
name: harmony-${{ matrix.os }}
123123
path: harmony/bin/*
124124
retention-days: 1
125125

126+
merge_artifacts:
127+
runs-on: ubuntu-22.04
128+
needs: build
129+
steps:
130+
- name: Merge Artifacts
131+
uses: actions/upload-artifact/merge@v4
132+
with:
133+
name: harmony
134+
126135
docker-build:
127136
name: Build and push harmony docker image
128-
needs: [check, build]
137+
needs: [check, build, merge_artifacts]
129138
runs-on: ubuntu-22.04
130139
if: needs.check.outputs.tag_annotated == 'true'
131140

132141
steps:
133142
- name: Checkout harmony core code
134-
uses: actions/checkout@v3
143+
uses: actions/checkout@v4
135144
with:
136145
path: harmony
137146
ref: ${{ github.event.inputs.tag }}
@@ -146,7 +155,7 @@ jobs:
146155
working-directory: harmony
147156

148157
- name: Download artifact
149-
uses: actions/download-artifact@v3
158+
uses: actions/download-artifact@v4
150159
with:
151160
name: harmony
152161

@@ -156,16 +165,16 @@ jobs:
156165
working-directory: harmony
157166

158167
- name: Set up Docker Buildx
159-
uses: docker/setup-buildx-action@v2
168+
uses: docker/setup-buildx-action@v3
160169

161170
- name: Login to DockerHub
162-
uses: docker/login-action@v2
171+
uses: docker/login-action@v3
163172
with:
164173
username: ${{ secrets.DOCKER_USERNAME }}
165174
password: ${{ secrets.DOCKER_PASSWORD }}
166175

167176
- name: Build and push
168-
uses: docker/build-push-action@v3
177+
uses: docker/build-push-action@v6
169178
with:
170179
context: ./harmony/scripts/docker
171180
file: ./harmony/scripts/docker/Dockerfile
@@ -178,19 +187,19 @@ jobs:
178187
179188
release-page:
180189
name: Sign binary and create and publish release page
181-
needs: [check, build]
190+
needs: [check, build, merge_artifacts]
182191
runs-on: ubuntu-22.04
183192
if: needs.check.outputs.tag_annotated == 'true'
184193

185194
steps:
186195
- name: Import GPG key
187-
uses: crazy-max/ghaction-import-gpg@v5
196+
uses: crazy-max/ghaction-import-gpg@v6
188197
with:
189198
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
190199
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASS }}
191200

192201
- name: Checkout harmony core code
193-
uses: actions/checkout@v3
202+
uses: actions/checkout@v4
194203
with:
195204
path: harmony
196205
ref: ${{ github.event.inputs.tag }}
@@ -207,7 +216,7 @@ jobs:
207216
working-directory: harmony
208217

209218
- name: Download artifact
210-
uses: actions/download-artifact@v3
219+
uses: actions/download-artifact@v4
211220
with:
212221
name: harmony
213222

.github/workflows/ci.yaml

+29-20
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Checkout harmony core code
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
path: harmony
2121
ref: ${{ github.ref }}
@@ -27,9 +27,9 @@ jobs:
2727
VERSION=$(git tag -l --sort=-v:refname | head -n 1)
2828
if git rev-parse $VERSION^{tag} -- &>/dev/null
2929
then
30-
echo "::set-output name=tag_annotated::true"
30+
echo "tag_annotated=true" >> $GITHUB_OUTPUT
3131
else
32-
echo "::set-output name=tag_annotated::false"
32+
echo "tag_annotated=false" >> $GITHUB_OUTPUT
3333
fi
3434
working-directory: harmony
3535

@@ -45,32 +45,32 @@ jobs:
4545
steps:
4646
- name: Import GPG key
4747
if: join(matrix.os, '-') != 'self-hosted-linux-ARM64'
48-
uses: crazy-max/ghaction-import-gpg@v5
48+
uses: crazy-max/ghaction-import-gpg@v6
4949
with:
5050
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
5151
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASS }}
5252

5353
- name: Checkout dependence repo
54-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
5555
with:
5656
repository: harmony-one/mcl
5757
path: mcl
5858

5959
- name: Checkout dependence repo
60-
uses: actions/checkout@v3
60+
uses: actions/checkout@v4
6161
with:
6262
repository: harmony-one/bls
6363
path: bls
6464

6565
- name: Checkout harmony core code
66-
uses: actions/checkout@v3
66+
uses: actions/checkout@v4
6767
with:
6868
path: harmony
6969
ref: ${{ github.ref }}
7070
fetch-depth: 0
7171

7272
- name: Set up Go with go.mod
73-
uses: actions/setup-go@v3
73+
uses: actions/setup-go@v5
7474
with:
7575
go-version-file: 'harmony/go.mod'
7676

@@ -119,21 +119,30 @@ jobs:
119119
working-directory: harmony
120120

121121
- name: Upload artifact
122-
uses: actions/upload-artifact@v2
122+
uses: actions/upload-artifact@v4
123123
with:
124-
name: harmony
124+
name: harmony-${{ matrix.os }}
125125
path: harmony/bin/*
126126
retention-days: 1
127127

128+
merge_artifacts:
129+
runs-on: ubuntu-22.04
130+
needs: build
131+
steps:
132+
- name: Merge Artifacts
133+
uses: actions/upload-artifact/merge@v4
134+
with:
135+
name: harmony
136+
128137
docker-build:
129138
name: Build and push harmony docker image
130-
needs: [check, build]
139+
needs: [check, build, merge_artifacts]
131140
runs-on: ubuntu-22.04
132141
if: needs.check.outputs.tag_annotated == 'true'
133142

134143
steps:
135144
- name: Checkout harmony core code
136-
uses: actions/checkout@v3
145+
uses: actions/checkout@v4
137146
with:
138147
path: harmony
139148
ref: ${{ github.ref }}
@@ -148,7 +157,7 @@ jobs:
148157
working-directory: harmony
149158

150159
- name: Download artifact
151-
uses: actions/download-artifact@v3
160+
uses: actions/download-artifact@v4
152161
with:
153162
name: harmony
154163

@@ -158,16 +167,16 @@ jobs:
158167
working-directory: harmony
159168

160169
- name: Set up Docker Buildx
161-
uses: docker/setup-buildx-action@v2
170+
uses: docker/setup-buildx-action@v3
162171

163172
- name: Login to DockerHub
164-
uses: docker/login-action@v2
173+
uses: docker/login-action@v3
165174
with:
166175
username: ${{ secrets.DOCKER_USERNAME }}
167176
password: ${{ secrets.DOCKER_PASSWORD }}
168177

169178
- name: Build and push
170-
uses: docker/build-push-action@v3
179+
uses: docker/build-push-action@v6
171180
with:
172181
context: ./harmony/scripts/docker
173182
file: ./harmony/scripts/docker/Dockerfile
@@ -180,19 +189,19 @@ jobs:
180189
181190
release-page:
182191
name: Sign binary and create and publish release page
183-
needs: [check, build]
192+
needs: [check, build, merge_artifacts]
184193
runs-on: ubuntu-22.04
185194
if: needs.check.outputs.tag_annotated == 'true'
186195

187196
steps:
188197
- name: Import GPG key
189-
uses: crazy-max/ghaction-import-gpg@v5
198+
uses: crazy-max/ghaction-import-gpg@v6
190199
with:
191200
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
192201
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASS }}
193202

194203
- name: Checkout harmony core code
195-
uses: actions/checkout@v3
204+
uses: actions/checkout@v4
196205
with:
197206
path: harmony
198207
ref: ${{ github.ref }}
@@ -209,7 +218,7 @@ jobs:
209218
working-directory: harmony
210219

211220
- name: Download artifact
212-
uses: actions/download-artifact@v3
221+
uses: actions/download-artifact@v4
213222
with:
214223
name: harmony
215224

0 commit comments

Comments
 (0)