13
13
fail-fast : false
14
14
matrix :
15
15
os :
16
- - ubuntu-22 .04
17
- - macos-12 # Intel
18
- - macos-13-xlarge # Apple silicon
16
+ - ubuntu-24 .04
17
+ - macos-13 # Intel
18
+ - macos-14 # Apple silicon
19
19
- windows-2022
20
20
ghc-version :
21
21
- " 8.8"
@@ -24,20 +24,22 @@ jobs:
24
24
- " 9.2"
25
25
- " 9.4"
26
26
exclude :
27
- - os : macos-12
27
+ - os : macos-13
28
28
ghc-version : " 8.10"
29
- - os : macos-12
29
+ - os : macos-13
30
30
ghc-version : " 9.0"
31
- - os : macos-12
31
+ - os : macos-13
32
32
ghc-version : " 9.2"
33
- - os : macos-13-xlarge
33
+ - os : macos-14
34
34
ghc-version : " 8.8"
35
- - os : macos-13-xlarge
35
+ - os : macos-14
36
36
ghc-version : " 8.10"
37
- - os : macos-13-xlarge
37
+ - os : macos-14
38
38
ghc-version : " 9.0"
39
- - os : macos-13-xlarge
39
+ - os : macos-14
40
40
ghc-version : " 9.2"
41
+ - os : windows-2022
42
+ ghc-version : " 8.8"
41
43
- os : windows-2022
42
44
ghc-version : " 8.10"
43
45
- os : windows-2022
70
72
%APPDATA%\cabal\store
71
73
%APPDATA%\stack
72
74
key : stack-${{ matrix.os }}-ghc-${{ matrix.version }}
75
+ - name : Install dependencies (Linux)
76
+ if : " startsWith(matrix.os, 'ubuntu-')"
77
+ run : |
78
+ sudo apt install libbz2-dev
73
79
- name : Install Haskell Stack (if not installed)
74
80
shell : bash
75
81
run : |
@@ -121,14 +127,8 @@ jobs:
121
127
matrix.ghc-version == '9.2'
122
128
shell : bash
123
129
run : |
124
- curl -L -o /tmp/pandoc.deb \
125
- https://github.com/jgm/pandoc/releases/download/2.14.2/pandoc-2.14.2-1-amd64.deb
126
- sudo dpkg -i /tmp/pandoc.deb
127
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
128
- sudo add-apt-repository ppa:rmescandon/yq
129
- sudo apt update
130
- sudo apt-get install -y yq
131
- bash scripts/haddock-prologue/build.sh
130
+ sudo apt-get install -y pandoc yq
131
+ PATH="/usr/bin:$PATH" bash scripts/haddock-prologue/build.sh
132
132
- name : Copy docs
133
133
if : >-
134
134
startsWith(matrix.os, 'ubuntu-') &&
@@ -178,9 +178,9 @@ jobs:
178
178
fail-fast : false
179
179
matrix :
180
180
os :
181
- - ubuntu-22 .04
182
- - macos-12 # Intel
183
- - macos-13-xlarge # Apple silicon
181
+ - ubuntu-24 .04
182
+ - macos-13 # Intel
183
+ - macos-14 # Apple silicon
184
184
- windows-2022
185
185
steps :
186
186
- uses : actions/checkout@v4
@@ -266,12 +266,21 @@ jobs:
266
266
267
267
image :
268
268
name : Docker image
269
- runs-on : ubuntu-22.04
269
+ strategy :
270
+ fail-fast : false
271
+ matrix :
272
+ os :
273
+ - ubuntu-24.04
274
+ - ubuntu-24.04-arm
275
+ runs-on : ${{ matrix.os }}
270
276
env :
271
277
DOCKERHUB_IMAGE_NAME : seonbi
272
278
outputs :
273
279
image-ghcr : ghcr.io/${{ github.repository }}/bin@${{ steps.push-image.outputs.digest }}
274
280
image-dockerhub : docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}@${{ steps.push-image.outputs.digest }}
281
+ tag : ${{ steps.values.outputs.tag }}
282
+ labels : ${{ steps.values.outputs.labels }}
283
+ arch : ${{ steps.values.outputs.arch }}
275
284
steps :
276
285
- uses : actions/checkout@v4
277
286
with :
@@ -303,6 +312,11 @@ jobs:
303
312
else
304
313
echo labels= >> "$GITHUB_OUTPUT"
305
314
fi
315
+ if [[ "$RUNNER_ARCH" = "ARM64" ]]; then
316
+ echo arch=arm64 >> "$GITHUB_OUTPUT"
317
+ else
318
+ echo arch=amd64 >> "$GITHUB_OUTPUT"
319
+ fi
306
320
- id : push-image
307
321
uses : docker/build-push-action@v6
308
322
with :
@@ -313,19 +327,48 @@ jobs:
313
327
org.opencontainers.image.url=${{ github.event.repository.html_url }}
314
328
${{ steps.values.outputs.labels }}
315
329
tags : |
316
- ghcr.io/${{ github.repository }}/bin:${{ steps.values.outputs.tag }}
317
- ${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.values.outputs.tag }}
330
+ ghcr.io/${{ github.repository }}/bin:${{ steps.values.outputs.tag }}-${{ steps.values.outputs.arch }}
331
+ ${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.values.outputs.tag }}-${{ steps.values.outputs.arch }}
318
332
provenance : false # https://community.fly.io/t/deploying-to-fly-via-github-action-failing/10171/33
319
333
334
+ image-manifest :
335
+ name : Create and push manifest images
336
+ if : github.event_name != 'pull_request'
337
+ needs :
338
+ - image
339
+ runs-on : ubuntu-24.04
340
+ env :
341
+ DOCKERHUB_IMAGE_NAME : seonbi
342
+ steps :
343
+ - uses : docker/login-action@v3
344
+ with :
345
+ registry : ghcr.io
346
+ username : ${{ github.repository_owner }}
347
+ password : ${{ github.token }}
348
+ - uses : docker/login-action@v3
349
+ with :
350
+ username : ${{ vars.DOCKERHUB_USERNAME }}
351
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
352
+ -
uses :
Noelware/[email protected]
353
+ with :
354
+ inputs : ghcr.io/${{ github.repository }}/bin:${{ needs.image.outputs.tag }}
355
+ images : ghcr.io/${{ github.repository }}/bin:${{ needs.image.outputs.tag }}-amd64,ghcr.io/${{ github.repository }}/bin:${{ needs.image.outputs.tag }}-arm64
356
+ push : true
357
+ -
uses :
Noelware/[email protected]
358
+ with :
359
+ inputs : docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ needs.image.outputs.tag }}
360
+ images : docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ needs.image.outputs.tag }}-amd64,docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ needs.image.outputs.tag }}-arm64
361
+ push : true
362
+
320
363
fly :
321
364
name : Deploy seonbi-api to Fly.io
322
365
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
323
366
needs :
324
367
- image
325
368
env :
326
369
FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
327
- IMAGE : ${{ needs.image.outputs.image-ghcr }}
328
- runs-on : ubuntu-22 .04
370
+ IMAGE : ghcr.io/ ${{ github.repository }}/bin:${{ needs.image.outputs.tag }}-amd64
371
+ runs-on : ubuntu-24 .04
329
372
steps :
330
373
- uses : actions/checkout@v4
331
374
- uses : superfly/flyctl-actions/setup-flyctl@master
@@ -345,36 +388,54 @@ jobs:
345
388
needs :
346
389
- build
347
390
- image
348
- runs-on : ubuntu-22 .04
391
+ runs-on : ubuntu-24 .04
349
392
steps :
350
393
- uses : actions/checkout@v4
351
394
- uses : actions/download-artifact@v4
352
395
with :
353
- name : binaries-macos-13-xlarge -ghc-9.4
396
+ name : binaries-macos-14 -ghc-9.4
354
397
path : /tmp/binaries-macos-arm64
355
398
- uses : actions/download-artifact@v4
356
399
with :
357
- name : binaries-macos-12 -ghc-9.4
400
+ name : binaries-macos-13 -ghc-9.4
358
401
path : /tmp/binaries-macos-x86_64
359
402
- uses : actions/download-artifact@v4
360
403
with :
361
404
name : binaries-windows-2022-ghc-9.2
362
405
path : /tmp/binaries-windows
406
+ - uses : docker/setup-qemu-action@v3
407
+ with :
408
+ platforms : arm64
409
+ - uses : docker/setup-buildx-action@v3
363
410
- run : |
364
411
set -e
365
412
mkdir -p /tmp/dists
366
- # Linux
367
- docker pull "$IMAGE"
368
- mkdir -p /tmp/binaries-linux
369
- docker run -i "$IMAGE" cat /usr/local/bin/seonbi \
370
- > /tmp/binaries-linux/seonbi
371
- docker run -i "$IMAGE" cat /usr/local/bin/seonbi-api \
372
- > /tmp/binaries-linux/seonbi-api
373
- pushd /tmp/binaries-linux
413
+ # Linux (amd64)
414
+ docker pull "$IMAGE-amd64 "
415
+ mkdir -p /tmp/binaries-linux-amd64
416
+ docker run -i "$IMAGE-amd64 " cat /usr/local/bin/seonbi \
417
+ > /tmp/binaries-linux-amd64 /seonbi
418
+ docker run -i "$IMAGE-amd64 " cat /usr/local/bin/seonbi-api \
419
+ > /tmp/binaries-linux-amd64 /seonbi-api
420
+ pushd /tmp/binaries-linux-amd64
374
421
chmod +x *
375
422
cp "$GITHUB_WORKSPACE/"{LICENSE,README.md,CHANGES.md} ./
376
423
tar cvfj /tmp/dists/seonbi.linux-x86_64.tar.bz2 *
377
424
popd
425
+ # Linux (arm64)
426
+ docker pull "$IMAGE-arm64"
427
+ mkdir -p /tmp/binaries-linux-arm64
428
+ docker run -i --platform linux/arm64 "$IMAGE-arm64" \
429
+ cat /usr/local/bin/seonbi \
430
+ > /tmp/binaries-linux-arm64/seonbi
431
+ docker run -i --platform linux/arm64 "$IMAGE-arm64" \
432
+ cat /usr/local/bin/seonbi-api \
433
+ > /tmp/binaries-linux-arm64/seonbi-api
434
+ pushd /tmp/binaries-linux-arm64
435
+ chmod +x *
436
+ cp "$GITHUB_WORKSPACE/"{LICENSE,README.md,CHANGES.md} ./
437
+ tar cvfj /tmp/dists/seonbi.linux-arm64.tar.bz2 *
438
+ popd
378
439
# macOS (Apple silicon)
379
440
pushd /tmp/binaries-macos-arm64
380
441
chmod +x *
@@ -393,7 +454,7 @@ jobs:
393
454
zip /tmp/dists/seonbi.win64.zip *
394
455
popd
395
456
env:
396
- IMAGE: ${{ needs.image.outputs.image-ghcr }}
457
+ IMAGE: ghcr.io/ ${{ github.repository }}/bin:${{ needs.image.outputs.tag }}
397
458
- uses : actions/upload-artifact@v4
398
459
with :
399
460
name : dists-untagged
@@ -404,12 +465,12 @@ jobs:
404
465
needs :
405
466
- build
406
467
- binaries
407
- runs-on : ubuntu-22 .04
468
+ runs-on : ubuntu-24 .04
408
469
steps :
409
470
- uses : actions/checkout@v4
410
471
- uses : actions/download-artifact@v4
411
472
with :
412
- name : sdist-ubuntu-22 .04-ghc-9.4
473
+ name : sdist-ubuntu-24 .04-ghc-9.4
413
474
path : /tmp/sdist
414
475
- uses : actions/download-artifact@v4
415
476
with :
@@ -458,7 +519,7 @@ jobs:
458
519
if : >-
459
520
github.event_name != 'pull_request' &&
460
521
github.ref == 'refs/heads/main'
461
- runs-on : ubuntu-22 .04
522
+ runs-on : ubuntu-24 .04
462
523
steps :
463
524
- uses : actions/checkout@v4
464
525
- uses : actions/download-artifact@v4
0 commit comments