@@ -2,7 +2,7 @@ name: Build and Release
22
33on :
44 push :
5- branches : [main]
5+ branches : [main, dev ]
66 tags :
77 - " v*"
88 pull_request :
1818 run : |
1919 apk add --no-cache git make gcc musl-dev
2020
21- - uses : actions/checkout@v3
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+ with :
24+ fetch-depth : 0
2225
2326 - name : Configure Git safe directory
2427 run : |
@@ -37,20 +40,23 @@ jobs:
3740 if : startsWith(github.ref, 'refs/tags/v')
3841 runs-on : ubuntu-latest
3942 steps :
40- - uses : actions/checkout@v3
43+ - name : Checkout code
44+ uses : actions/checkout@v4
45+ with :
46+ fetch-depth : 0
4147
4248 - name : Set up Docker Buildx
43- uses : docker/setup-buildx-action@v2
49+ uses : docker/setup-buildx-action@v3
4450
4551 - name : Login to DockerHub
46- uses : docker/login-action@v2
52+ uses : docker/login-action@v3
4753 with :
4854 username : ${{ secrets.DOCKERHUB_USERNAME }}
4955 password : ${{ secrets.DOCKERHUB_TOKEN }}
5056
5157 - name : Extract metadata for Docker
5258 id : meta
53- uses : docker/metadata-action@v4
59+ uses : docker/metadata-action@v5
5460 with :
5561 images : hetuproject/checkpoint-dispatcher,hetuproject/checkpoint-validator
5662 tags : |
5965 type=sha
6066
6167 - name : Build and push dispatcher image
62- uses : docker/build-push-action@v4
68+ uses : docker/build-push-action@v5
6369 with :
6470 context : .
6571 file : ./docker/dispatcher/Dockerfile
7076 platforms : linux/amd64,linux/arm64
7177
7278 - name : Build and push validator image
73- uses : docker/build-push-action@v4
79+ uses : docker/build-push-action@v5
7480 with :
7581 context : .
7682 file : ./docker/validator/Dockerfile
9197 run : |
9298 apk add --no-cache git make gcc musl-dev zip tar
9399
94- - uses : actions/checkout@v3
100+ - name : Checkout code
101+ uses : actions/checkout@v4
102+ with :
103+ fetch-depth : 0
95104
96105 - name : Configure Git safe directory
97106 run : |
@@ -126,21 +135,20 @@ jobs:
126135 cd build/darwin/amd64 && tar -czvf ../../../release/checkpoint-darwin-amd64.tar.gz * && cd -
127136 cd build/windows/amd64 && zip -r ../../../release/checkpoint-windows-amd64.zip * && cd -
128137
129- - name : Upload artifacts
130- uses : actions/upload-artifact@v3
131- with :
132- name : release-binaries
133- path : release/
138+ # use GitHub CLI to replace actions/upload-artifact
139+ - name : Install GitHub CLI
140+ run : |
141+ apk add --no-cache github-cli
134142
135- - name : Create Release
136- uses : softprops/action-gh-release@v1
137- with :
138- files : |
139- release/checkpoint-linux-amd64.tar.gz
140- release/checkpoint-linux-arm64.tar.gz
141- release/checkpoint-darwin-amd64.tar.gz
142- release/checkpoint-windows-amd64.zip
143- draft : false
144- prerelease : false
143+ - name : Create GitHub Release
145144 env :
146145 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
146+ run : |
147+ VERSION=${GITHUB_REF#refs/tags/}
148+ gh release create $VERSION \
149+ --title "Release $VERSION" \
150+ --notes "Release $VERSION" \
151+ release/checkpoint-linux-amd64.tar.gz \
152+ release/checkpoint-linux-arm64.tar.gz \
153+ release/checkpoint-darwin-amd64.tar.gz \
154+ release/checkpoint-windows-amd64.zip
0 commit comments