1
1
name : Release
2
2
3
3
on :
4
+ workflow_dispatch :
4
5
push :
5
6
tags :
6
7
- " v*"
9
10
GO_VERSION : " 1.22.x"
10
11
11
12
jobs :
12
- release-github :
13
- name : Build & Release Binaries
13
+ build :
14
+ name : Build Binaries
14
15
runs-on : ${{ matrix.os }}
15
16
strategy :
16
17
matrix :
17
18
os : [ ubuntu-22.04, macos-latest ]
18
19
steps :
19
- # Setup
20
20
- uses : actions/checkout@v4
21
21
- name : Setup Go environment
22
22
uses : actions/setup-go@v5
@@ -33,10 +33,65 @@ jobs:
33
33
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
34
34
eval "$(/opt/homebrew/bin/brew shellenv)"
35
35
brew install mingw-w64
36
- # Go Build
37
36
- name : Build Binary
38
37
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
40
95
- name : Extract Tag from Ref
41
96
if : startsWith(github.ref, 'refs/tags/')
42
97
id : tag
53
108
with :
54
109
allowUpdates : true
55
110
artifactErrorsFailBuild : true
56
- artifacts : dist/*
111
+ artifacts : |
112
+ dist/*
57
113
makeLatest : ${{ steps.semver.outputs.prerelease == '' }}
58
114
generateReleaseNotes : true
59
115
prerelease : ${{ steps.semver.outputs.prerelease != '' }}
0 commit comments