Skip to content

Commit db48f96

Browse files
committed
feat: ci: use softprops/action-gh-release@v2 for release push
1 parent fe76164 commit db48f96

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

.github/workflows/build-release.yml

+13-24
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Go
2323
uses: actions/setup-go@v4
2424
with:
25-
go-version: '1.22.6'
25+
go-version: "1.22.6"
2626

2727
- name: Build binary
2828
run: |
@@ -54,26 +54,15 @@ jobs:
5454
name: binaries
5555

5656
- name: Create a release in weave-binaries
57-
run: |
58-
RELEASE_ID=$(curl -s -X POST \
59-
-H "Authorization: token ${{ secrets.WEAVE_BINARIES_GITHUB_TOKEN }}" \
60-
-H "Accept: application/vnd.github.v3+json" \
61-
https://api.github.com/repos/initia-labs/weave-binaries/releases \
62-
-d '{
63-
"tag_name": "${{ github.event.release.tag_name }}",
64-
"target_commitish": "main",
65-
"name": "${{ github.event.release.name }}",
66-
"body": "Release for ${{ github.event.release.tag_name }}",
67-
"draft": false,
68-
"prerelease": false
69-
}' | jq -r '.id')
70-
71-
for file in build/darwin-amd64/weave build/darwin-arm64/weave build/linux-amd64/weave build/linux-arm64/weave; do
72-
curl -X POST \
73-
-H "Authorization: token ${{ secrets.WEAVE_BINARIES_GITHUB_TOKEN }}" \
74-
-H "Content-Type: application/octet-stream" \
75-
--data-binary @$file \
76-
"https://uploads.github.com/repos/initia-labs/weave-binaries/releases/$RELEASE_ID/assets?name=$(basename $file)"
77-
done
78-
env:
79-
WEAVE_BINARIES_GITHUB_TOKEN: ${{ secrets.WEAVE_BINARIES_GITHUB_TOKEN }}
57+
uses: softprops/action-gh-release@v2
58+
if: startsWith(github.ref, 'refs/tags/')
59+
with:
60+
repository: initia-labs/weave-binaries
61+
draft: false
62+
prerelease: true
63+
token: ${{ secrets.WEAVE_BINARIES_GITHUB_TOKEN }}
64+
files: |
65+
build/darwin-amd64/weave
66+
build/darwin-arm64/weave
67+
build/linux-amd64/weave
68+
build/linux-arm64/weave

0 commit comments

Comments
 (0)