-
Notifications
You must be signed in to change notification settings - Fork 39
76 lines (63 loc) · 1.98 KB
/
build-release-artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build Release Binaries
on:
release:
types:
- created
- edited
# pull_request:
# branches:
# - main
permissions:
id-token: write
contents: write
pull-requests: write
actions: write
jobs:
Timestamp:
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main
build:
needs: Timestamp
name: Build Release Assets
runs-on: ubuntu-latest
strategy:
matrix:
platform:
[linux-amd64, linux-arm64, darwin-amd64, darwin-arm64]
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.0'
- name: Display Go version
run: go version
- name: Display the release tag
run: |
echo "Release tag: ${{ github.event.release.tag_name }}"
- name: Set up environment for cross-compilation
run: |
IFS="-" read -r GOOS GOARCH <<< "${{ matrix.platform }}"
output_name=story-${{ matrix.platform }}
echo "Building for $GOOS/$GOARCH..."
cd client
env GOOS=$GOOS GOARCH=$GOARCH go build -o $output_name
- name: Calculate checksum
run: |
sha256sum ./client/story-${{ matrix.platform }} > ./client/story-${{ matrix.platform }}.sha256
- name: Upload binaries and source code to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
file: |
./client/story-${{ matrix.platform }}
file_glob: false
- name: Upload binaries and source code to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
file: |
./client/story-${{ matrix.platform }}.sha256
file_glob: false