@@ -10,32 +10,63 @@ permissions:
1010 packages : write
1111
1212jobs :
13- release :
14- runs-on : ubuntu-latest
13+ build :
14+ name : Release Binary (${{ matrix.goos }}-${{ matrix.goarch }})
15+ runs-on : ${{ matrix.runner }}
16+ strategy :
17+ fail-fast : false
18+ matrix :
19+ include :
20+ - goos : linux
21+ goarch : amd64
22+ runner : ubuntu-latest
23+ ext : " "
24+ - goos : linux
25+ goarch : arm64
26+ runner : ubuntu-24.04-arm64
27+ ext : " "
28+ - goos : darwin
29+ goarch : arm64
30+ runner : macos-latest
31+ ext : " "
32+ - goos : windows
33+ goarch : amd64
34+ runner : windows-latest
35+ ext : " .exe"
36+
1537 steps :
1638 - uses : actions/checkout@v5
17-
1839 - uses : actions/setup-go@v5
1940 with :
20- go-version : " 1.24"
41+ go-version : 1.24
2142
22- - name : Install cross-compilers
23- run : sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu gcc-mingw-w64
24-
25- - name : Set Env
43+ - name : Build binary
44+ shell : bash
2645 run : |
27- echo "THOR_VERSION=$(cat cmd/thor/VERSION)" >> $GITHUB_ENV
28- echo "DISCO_VERSION=$(cat cmd/disco/VERSION)" >> $GITHUB_ENV
29- echo "COPYRIGHT_YEAR=$(git --no-pager log -1 --format=%ad --date=format:%Y)" >> $GITHUB_ENV
46+ go mod tidy
47+ make thor
48+ mkdir -p dist
49+ mv ./bin/thor dist/thor_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.ext }}
3050
31- - name : Run GoReleaser
32- uses : goreleaser/goreleaser-action@v6
33- with :
34- version : latest
35- args : release --clean
3651 env :
37- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38- THOR_VERSION : ${{ env.THOR_VERSION }}
39- DISCO_VERSION : ${{ env.DISCO_VERSION }}
40- COPYRIGHT_YEAR : ${{ env.COPYRIGHT_YEAR }}
52+ GOOS : ${{ matrix.goos }}
53+ GOARCH : ${{ matrix.goarch }}
4154 CGO_ENABLED : 1
55+
56+ - uses : actions/upload-artifact@v4
57+ with :
58+ name : thor_${{ matrix.goos }}_${{ matrix.goarch }}
59+ path : dist/thor_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.ext }}
60+
61+ release :
62+ name : Create GitHub Release
63+ runs-on : ubuntu-latest
64+ needs : build
65+ steps :
66+ - uses : actions/download-artifact@v5
67+ with :
68+ path : dist
69+ - uses : ncipollo/release-action@v1
70+ with :
71+ artifacts : " dist/**/*"
72+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments