66 - " v*"
77
88env :
9- GO_VERSION : " 1.23.4 "
10- REGISTRY_IMAGE : " ghcr.io/proofrock/ws4sql "
9+ GO_VERSION : " 1.23.5 "
10+ REGISTRY_IMAGE : " ghcr.io/proofrock/ws4sql_test "
1111
1212jobs :
1313 test :
@@ -31,22 +31,24 @@ jobs:
3131 - name : Checkout
3232 uses : actions/checkout@v4
3333
34- - uses : actions/setup-go@v5
35- with :
36- go-version : ${{ env.GO_VERSION }}
37-
3834 - name : Modify version number
3935 run : sed -i 's/v0\.0\.0/${{ github.ref_name }}/g' ws4sql.go
4036 working-directory : src/
4137
4238 - name : Build dir generation
4339 run : mkdir bin/
4440
41+ - name : Setup Alpine chroot
42+ uses : jirutka/setup-alpine@v1
43+ with :
44+ branch : edge
45+
4546 - name : Compile and Pack Artifact
4647 run : |
47- make build-static
48+ apk add --no-cache musl-dev go g++ git make openssl openssl-dev openssl-libs-static zstd
49+ make build-static-linux-musl-amd64
4850 tar czf bin/ws4sql-${{ github.ref_name }}-linux-amd64.tar.gz -C bin/ ws4sql
49- rm bin/ws4sql
51+ shell : alpine.sh --root {0}
5052
5153 - name : Upload artifacts
5254 uses : actions/upload-artifact@v4
5557 path : bin/ws4sql-${{ github.ref_name }}-linux-amd64.tar.gz
5658 retention-days : 1
5759
58- # TODO build_linux_arm64
60+ build_linux_arm64 :
61+ runs-on : ubuntu-latest
62+
63+ steps :
64+ - name : Checkout
65+ uses : actions/checkout@v4
66+
67+ - name : Modify version number
68+ run : sed -i 's/v0\.0\.0/${{ github.ref_name }}/g' ws4sql.go
69+ working-directory : src/
70+
71+ - name : Build dir generation
72+ run : mkdir bin/
73+
74+ - name : Setup Alpine chroot
75+ uses : jirutka/setup-alpine@v1
76+ with :
77+ arch : aarch64
78+ branch : edge
79+
80+ - name : Compile and Pack Artifact
81+ run : |
82+ apk add --no-cache musl-dev go g++ git make openssl openssl-dev openssl-libs-static zstd
83+ make build-static-linux-musl-arm64
84+ tar czf bin/ws4sql-${{ github.ref_name }}-linux-arm64.tar.gz -C bin/ ws4sql
85+ shell : alpine.sh --root {0}
86+
87+ - name : Upload artifacts
88+ uses : actions/upload-artifact@v4
89+ with :
90+ name : binary_linux_arm64
91+ path : bin/ws4sql-${{ github.ref_name }}-linux-arm64.tar.gz
92+ retention-days : 1
5993
6094 build_macos_arm64 :
6195 runs-on : macos-latest
@@ -122,28 +156,111 @@ jobs:
122156 path : bin/ws4sql-${{ github.ref_name }}-win-amd64.zip
123157 retention-days : 1
124158
159+ build_docker :
160+ needs :
161+ - build_linux_amd64
162+ - build_linux_arm64
163+ runs-on : ubuntu-latest
164+ strategy :
165+ fail-fast : false
166+ matrix :
167+ platform :
168+ - linux/amd64
169+ - linux/arm64
170+ steps :
171+ - name : Prepare
172+ run : |
173+ platform=${{ matrix.platform }}
174+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
175+ echo "PLATFORM_PAIR_UNDERSCORE=${platform//\//_}" >> $GITHUB_ENV
176+
177+ - name : Checkout
178+ uses : actions/checkout@v4
179+
180+ - name : Download artifact
181+ uses : actions/download-artifact@v4
182+ with :
183+ name : binary_${{ env.PLATFORM_PAIR_UNDERSCORE }}
184+ path : bin/
185+
186+ - name : Unpack artifact
187+ run : |
188+ tar xzf *.tar.gz
189+ chmod +x ws4sql # Probably unnecessary
190+ working-directory : bin/
191+
192+ - name : Docker meta
193+ id : meta
194+ uses : docker/metadata-action@v5
195+ with :
196+ images : ${{ env.REGISTRY_IMAGE }}
197+
198+ # - name: Set up QEMU
199+ # uses: docker/setup-qemu-action@v3
200+
201+ - name : Set up Docker Buildx
202+ uses : docker/setup-buildx-action@v3
203+
204+ - name : Login to Github Container Registry
205+ uses : docker/login-action@v3
206+ with :
207+ registry : ghcr.io
208+ username : ${{ github.actor }}
209+ password : ${{ secrets.TOKEN }}
210+
211+ - name : Build and push by digest
212+ id : build
213+ uses : docker/build-push-action@v5
214+ with :
215+ context : .
216+ platforms : ${{ matrix.platform }}
217+ labels : ${{ steps.meta.outputs.labels }}
218+ outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
219+
220+ - name : Export digest
221+ run : |
222+ mkdir -p /tmp/digests
223+ digest="${{ steps.build.outputs.digest }}"
224+ touch "/tmp/digests/${digest#sha256:}"
225+
226+ - name : Upload digest
227+ uses : actions/upload-artifact@v4
228+ with :
229+ name : digests-${{ env.PLATFORM_PAIR }}
230+ path : /tmp/digests/*
231+ if-no-files-found : error
232+ retention-days : 1
233+
125234 release :
126235 needs :
127236 - build_linux_amd64
237+ - build_linux_arm64
128238 - build_macos_arm64
129239 - build_win_amd64
240+ - build_docker
130241 - test
131242 runs-on : ubuntu-latest
132243
133244 steps :
134- - name : Download artifacts [1/3 ]
245+ - name : Download artifacts [1/4 ]
135246 uses : actions/download-artifact@v4
136247 with :
137248 name : binary_linux_amd64
138249 path : bin/
139250
140- - name : Download artifacts [2/3]
251+ - name : Download artifacts [2/4]
252+ uses : actions/download-artifact@v4
253+ with :
254+ name : binary_linux_arm64
255+ path : bin/
256+
257+ - name : Download artifacts [3/4]
141258 uses : actions/download-artifact@v4
142259 with :
143260 name : binary_macos_arm64
144261 path : bin/
145262
146- - name : Download artifacts [3/3 ]
263+ - name : Download artifacts [4/4 ]
147264 uses : actions/download-artifact@v4
148265 with :
149266 name : binary_win_amd64
@@ -174,6 +291,16 @@ jobs:
174291 asset_name : ws4sql-${{ github.ref_name }}-linux-amd64.tar.gz
175292 asset_content_type : application/gzip
176293
294+ - name : Release Artifact [linux/arm64]
295+ uses : actions/upload-release-asset@v1
296+ env :
297+ GITHUB_TOKEN : ${{ secrets.TOKEN }}
298+ with :
299+ upload_url : ${{ steps.create_release.outputs.upload_url }}
300+ asset_path : bin/ws4sql-${{ github.ref_name }}-linux-arm64.tar.gz
301+ asset_name : ws4sql-${{ github.ref_name }}-linux-arm64.tar.gz
302+ asset_content_type : application/gzip
303+
177304 - name : Release Artifact [darwin/arm64]
178305 uses : actions/upload-release-asset@v1
179306 env :
@@ -194,73 +321,10 @@ jobs:
194321 asset_name : ws4sql-${{ github.ref_name }}-win-amd64.zip
195322 asset_content_type : application/zip
196323
197- build-docker :
198- runs-on : ubuntu-latest
199- strategy :
200- fail-fast : false
201- matrix :
202- platform :
203- - linux/amd64
204- - linux/arm64
205- steps :
206- - name : Prepare
207- run : |
208- platform=${{ matrix.platform }}
209- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
210-
211- - name : Checkout
212- uses : actions/checkout@v4
213-
214- - name : Modify version number
215- run : sed -i 's/v0\.0\.0/${{ github.ref_name }}/g' ws4sql.go
216- working-directory : src/
217-
218- - name : Docker meta
219- id : meta
220- uses : docker/metadata-action@v5
221- with :
222- images : ${{ env.REGISTRY_IMAGE }}
223-
224- # - name: Set up QEMU
225- # uses: docker/setup-qemu-action@v3
226-
227- - name : Set up Docker Buildx
228- uses : docker/setup-buildx-action@v3
229-
230- - name : Login to Github Container Registry
231- uses : docker/login-action@v3
232- with :
233- registry : ghcr.io
234- username : ${{ github.actor }}
235- password : ${{ secrets.TOKEN }}
236-
237- - name : Build and push by digest
238- id : build
239- uses : docker/build-push-action@v5
240- with :
241- context : .
242- platforms : ${{ matrix.platform }}
243- labels : ${{ steps.meta.outputs.labels }}
244- outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
245-
246- - name : Export digest
247- run : |
248- mkdir -p /tmp/digests
249- digest="${{ steps.build.outputs.digest }}"
250- touch "/tmp/digests/${digest#sha256:}"
251-
252- - name : Upload digest
253- uses : actions/upload-artifact@v4
254- with :
255- name : digests-${{ env.PLATFORM_PAIR }}
256- path : /tmp/digests/*
257- if-no-files-found : error
258- retention-days : 1
259-
260- merge-docker :
324+ merge_docker :
261325 runs-on : ubuntu-latest
262326 needs :
263- - build-docker
327+ - build_docker
264328 - release
265329 - test
266330 steps :
0 commit comments