11name : Release
22
33on :
4+ workflow_dispatch :
45 push :
56 tags :
67 - " v*"
910 GO_VERSION : " 1.22.x"
1011
1112jobs :
12- release-github :
13- name : Build & Release Binaries
13+ build :
14+ name : Build Binaries
1415 runs-on : ${{ matrix.os }}
1516 strategy :
1617 matrix :
1718 os : [ ubuntu-22.04, macos-latest ]
1819 steps :
19- # Setup
2020 - uses : actions/checkout@v4
2121 - name : Setup Go environment
2222 uses : actions/setup-go@v5
@@ -33,10 +33,65 @@ jobs:
3333 echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
3434 eval "$(/opt/homebrew/bin/brew shellenv)"
3535 brew install mingw-w64
36- # Go Build
3736 - name : Build Binary
3837 run : make build-cross
39- # Create Git Release
38+ - name : Upload Artifacts
39+ uses : actions/upload-artifact@v4
40+ with :
41+ name : ${{ matrix.os }}-artifacts
42+ path : dist/*
43+ retention-days : 1
44+ if-no-files-found : error
45+
46+ collect-artifacts :
47+ name : Collect Artifacts and Generate Checksums
48+ runs-on : ubuntu-22.04
49+ needs : build
50+ steps :
51+ - name : Download Artifacts
52+ uses : actions/download-artifact@v4
53+ with :
54+ name : ubuntu-22.04-artifacts
55+ path : dist
56+ merge-multiple : true
57+ - name : Download Artifacts
58+ uses : actions/download-artifact@v4
59+ with :
60+ name : macos-latest-artifacts
61+ path : dist
62+ merge-multiple : true
63+ - name : Calculate Checksums
64+ run : |
65+ cd dist
66+ sha256sum knowledge-* > checksums.txt
67+ - name : Upload Checksums
68+ uses : actions/upload-artifact@v4
69+ with :
70+ name : checksums
71+ path : dist/checksums.txt
72+
73+ release :
74+ name : Create Release
75+ runs-on : ubuntu-22.04
76+ needs : collect-artifacts
77+ steps :
78+ - name : Download Artifacts
79+ uses : actions/download-artifact@v4
80+ with :
81+ name : ubuntu-22.04-artifacts
82+ path : dist
83+ merge-multiple : true
84+ - name : Download Artifacts
85+ uses : actions/download-artifact@v4
86+ with :
87+ name : macos-latest-artifacts
88+ path : dist
89+ - name : Download Checksums
90+ uses : actions/download-artifact@v4
91+ with :
92+ name : checksums
93+ path : dist
94+ merge-multiple : true
4095 - name : Extract Tag from Ref
4196 if : startsWith(github.ref, 'refs/tags/')
4297 id : tag
53108 with :
54109 allowUpdates : true
55110 artifactErrorsFailBuild : true
56- artifacts : dist/*
111+ artifacts : |
112+ dist/*
57113 makeLatest : ${{ steps.semver.outputs.prerelease == '' }}
58114 generateReleaseNotes : true
59115 prerelease : ${{ steps.semver.outputs.prerelease != '' }}
0 commit comments