@@ -13,15 +13,15 @@ jobs:
13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
- name : Checkout
16
- uses : actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
16
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17
17
- name : Ensure SHA pinned actions
18
- uses : zgosalvez/github-actions-ensure-sha-pinned-actions@21991cec25093947ff3f62e4c223df0260c39944
18
+ uses : zgosalvez/github-actions-ensure-sha-pinned-actions@2d6823da4039243036c86d76f503c84e2ded2517
19
19
xgo :
20
20
needs : harden_security
21
21
runs-on : ubuntu-latest
22
22
steps :
23
23
- name : Checkout
24
- uses : actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
24
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25
25
- name : Install zip utility
26
26
run : |
27
27
sudo apt update
@@ -37,10 +37,10 @@ jobs:
37
37
# go install golang.org/x/vuln/cmd/govulncheck@latest
38
38
# /home/runner/go/bin/govulncheck -json ./...
39
39
- name : Build znnd
40
- uses : crazy-max/ghaction-xgo@588a1a9bc6aa44305ce5d2c669c11687316f87bf
40
+ uses : crazy-max/ghaction-xgo@acf46aa99b919eb9ef6bba89dfd13bafa680667f
41
41
with :
42
- xgo_version : latest
43
- go_version : latest
42
+ xgo_version : " v0.36.0 "
43
+ go_version : 1.24.1
44
44
dest : build
45
45
prefix : znnd
46
46
pkg : cmd/znnd
@@ -52,10 +52,10 @@ jobs:
52
52
buildmode : default
53
53
trimpath : true
54
54
- name : Build libznn
55
- uses : crazy-max/ghaction-xgo@588a1a9bc6aa44305ce5d2c669c11687316f87bf
55
+ uses : crazy-max/ghaction-xgo@acf46aa99b919eb9ef6bba89dfd13bafa680667f
56
56
with :
57
- xgo_version : latest
58
- go_version : latest
57
+ xgo_version : " v0.36.0 "
58
+ go_version : 1.24.1
59
59
dest : build
60
60
prefix : libznn
61
61
pkg : cmd/libznn
@@ -67,11 +67,11 @@ jobs:
67
67
buildvcs : false
68
68
buildmode : c-shared
69
69
trimpath : true
70
- - name : Build libznn (windows/amd64)
71
- uses : crazy-max/ghaction-xgo@588a1a9bc6aa44305ce5d2c669c11687316f87bf
70
+ - name : Build libznn
71
+ uses : crazy-max/ghaction-xgo@acf46aa99b919eb9ef6bba89dfd13bafa680667f
72
72
with :
73
- xgo_version : latest
74
- go_version : 1.19.10
73
+ xgo_version : " v0.36.0 "
74
+ go_version : 1.24.1
75
75
dest : build
76
76
prefix : libznn
77
77
pkg : cmd/libznn
@@ -83,15 +83,15 @@ jobs:
83
83
buildvcs : false
84
84
buildmode : c-shared
85
85
trimpath : true
86
- # - name: Run makefat for darwin builds
87
- # run: |
88
- # cd ..
89
- # git clone https://github.com/randall77/makefat.git
90
- # cd makefat/
91
- # git checkout 7ddd0e42c8442593c87c1705a5545099604008e5
92
- # go build -o mainfat makefat.go
93
- # ./mainfat ../go-zenon/build/libznn-darwin-universal.dylib ../go-zenon/ build/libznn-darwin-amd64.dylib ../go-zenon/build/libznn-darwin-arm64 .dylib
94
- # ./mainfat ../go-zenon/build/znnd-darwin-universal ../go-zenon/ build/znnd -darwin-amd64 ../go-zenon/build/znnd-darwin- arm64
86
+ - name : Upload Darwin builds for makefat
87
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
88
+ with :
89
+ name : darwin-bins
90
+ path : |
91
+ build/znnd-darwin-amd64
92
+ build/znnd-darwin-arm64
93
+ build/libznn-darwin-amd64.dylib
94
+ build/libznn -darwin-arm64.dylib
95
95
- name : Go back to build directory, remove header files and add execute flag
96
96
run : |
97
97
cd build/
@@ -102,16 +102,21 @@ jobs:
102
102
cd build/
103
103
for file in *windows*; do zip $(echo $file | rev | cut -d '.' -f2- | rev)".zip" "$file" && rm "$file" ; done && for so in "linux" "darwin"; do for file in *"$so"*; do tar cvzf $(echo $file | rev | cut -d '.' -f2- | rev)".tar.gz" "$file" && rm "$file" ; done; done
104
104
- name : Generate checksums
105
- run : |
105
+ run : |
106
106
cd build/
107
107
sha256sum *
108
108
sha256sum * > SHA256CHECKSUMS.txt
109
+ - name : Upload slice checksums
110
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
111
+ with :
112
+ name : slice-checksums
113
+ path : build/SHA256CHECKSUMS.txt
109
114
- name : Set version
110
115
run : |
111
116
GOZENON=$(cat metadata/version.go | grep Version | awk -F '"' '{print $2}')
112
117
echo "GOZENON_VERSION=$GOZENON" >> $GITHUB_ENV
113
118
- name : Upload files to a GitHub release
114
- uses : svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7
119
+ uses : svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd
115
120
with :
116
121
repo_token : ${{ secrets.GITHUB_TOKEN }}
117
122
file : build/*
@@ -120,3 +125,66 @@ jobs:
120
125
file_glob : true
121
126
overwrite : true
122
127
body : " "
128
+ makefat :
129
+ name : Create universal Darwin binaries
130
+ needs : xgo
131
+ runs-on : macos-latest
132
+ steps :
133
+ - name : Checkout repo
134
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
135
+ - name : Download Darwin slices
136
+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
137
+ with :
138
+ name : darwin-bins
139
+ path : darwin-bins
140
+ - name : Download slice checksums
141
+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
142
+ with :
143
+ name : slice-checksums
144
+ path : slice-checksums
145
+ - name : Prepare output dir
146
+ run : |
147
+ mkdir -p universal
148
+ - name : Create universal znnd
149
+ run : |
150
+ lipo -create \
151
+ darwin-bins/znnd-darwin-amd64 \
152
+ darwin-bins/znnd-darwin-arm64 \
153
+ -output universal/znnd-darwin-universal
154
+ - name : Create universal libznn
155
+ run : |
156
+ lipo -create \
157
+ darwin-bins/libznn-darwin-amd64.dylib \
158
+ darwin-bins/libznn-darwin-arm64.dylib \
159
+ -output universal/libznn-darwin-universal.dylib
160
+ - name : Archive files
161
+ run : |
162
+ cd universal/
163
+ tar -czvf libznn-darwin-universal.tar.gz libznn-darwin-universal.dylib
164
+ tar -czvf znnd-darwin-universal.tar.gz znnd-darwin-universal
165
+ rm libznn-darwin-universal.dylib
166
+ rm znnd-darwin-universal
167
+ - name : Generate universal checksums
168
+ run : |
169
+ cd universal
170
+ shasum -a 256 * > UNIVERSAL_CHECKSUMS.txt
171
+ cd ..
172
+ - name : Merge all checksums
173
+ run : |
174
+ cat slice-checksums/SHA256CHECKSUMS.txt universal/UNIVERSAL_CHECKSUMS.txt > SHA256CHECKSUMS.txt
175
+ rm universal/UNIVERSAL_CHECKSUMS.txt
176
+ - name : Set version
177
+ run : |
178
+ GOZENON=$(grep Version metadata/version.go \
179
+ | awk -F '"' '{print $2}')
180
+ echo "GOZENON_VERSION=$GOZENON" >> $GITHUB_ENV
181
+ - name : Upload universal Darwin binaries
182
+ uses : svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd
183
+ with :
184
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
185
+ file : universal/*
186
+ release_name : ${{ env.GOZENON_VERSION }}
187
+ tag : ${{ env.GOZENON_VERSION }}-alphanet
188
+ overwrite : true
189
+ file_glob : true
190
+ body : " "
0 commit comments