1+ release-matrix : &release-matrix
2+ goos : [linux, darwin, windows]
3+ goarch : [amd64, arm64]
4+
15name : Create Tag
26
37on :
1519 runs-on : ubuntu-latest
1620 steps :
1721 - name : Checkout repository
18- uses : actions/checkout@v4.2.2
22+ uses : actions/checkout@v4
1923
2024 - name : Create Tag
2125 id : create_tag
@@ -24,29 +28,52 @@ jobs:
2428 git tag $TAG_NAME
2529 git push origin $TAG_NAME
2630
27- release :
31+ build :
2832 needs : create_tag
2933 name : Create Release
30- runs-on : ubuntu-latest
34+ runs-on : ubuntu-24.0§
35+ strategy :
36+ matrix : *release-matrix
3137
3238 steps :
3339 - name : Checkout code
34- uses : actions/checkout@v4.2.2
40+ uses : actions/checkout@v4
3541
3642 - name : Set up Go
37- uses : actions/setup-go@v5.3.0
43+ uses : actions/setup-go@v5
3844 with :
3945 go-version : ' 1.23.4'
40-
41- - name : Install dependencies
42- run : go mod download
4346
4447 - name : Build
45- run : make build
48+ run : make build GOOS=${{ matrix.goarch }} GOARCH=${{ matrix.goarch }}
49+
50+ - name : Upload artifact
51+ uses : actions/upload-artifact@v4
52+ with :
53+ name : shakespeare-${{ matrix.goos }}-${{ matrix.goarch }}
54+ path : dist/shakespeare
55+
56+
57+ release :
58+ needs : build
59+ runs-on : ubuntu-24.04
60+
61+ strategy :
62+ matrix : *release-matrix
63+
64+ steps :
65+ - name : Download artifacts
66+ uses : actions/download-artifact@v4
67+ with :
68+ name : shakespeare-${{ matrix.goos }}-${{ matrix.goarch }}
69+ path : dist/shakespeare-${{ matrix.goos }}-${{ matrix.goarch }}
70+
4671
4772 - name : Release
4873 uses : softprops/action-gh-release@v2
4974 with :
5075 token : ${{ secrets.RELEASE_GITHUB_TOKEN }}
5176 tag_name : ${{ github.event.inputs.tag_name }}
77+ files : |
78+ dist/shakespeare-${{ matrix.goos }}-${{ matrix.goarch }}
5279
0 commit comments