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,19 +24,19 @@ 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
41
- os : windows-2022
42
42
ghc-version : " 8.10"
70
70
%APPDATA%\cabal\store
71
71
%APPDATA%\stack
72
72
key : stack-${{ matrix.os }}-ghc-${{ matrix.version }}
73
+ - name : Install dependencies (Linux)
74
+ if : " startsWith(matrix.os, 'ubuntu-')"
75
+ run : |
76
+ sudo apt install libbz2-dev
73
77
- name : Install Haskell Stack (if not installed)
74
78
shell : bash
75
79
run : |
@@ -178,9 +182,9 @@ jobs:
178
182
fail-fast : false
179
183
matrix :
180
184
os :
181
- - ubuntu-22 .04
182
- - macos-12 # Intel
183
- - macos-13-xlarge # Apple silicon
185
+ - ubuntu-24 .04
186
+ - macos-13 # Intel
187
+ - macos-14 # Apple silicon
184
188
- windows-2022
185
189
steps :
186
190
- uses : actions/checkout@v4
@@ -266,12 +270,21 @@ jobs:
266
270
267
271
image :
268
272
name : Docker image
269
- runs-on : ubuntu-22.04
273
+ strategy :
274
+ fail-fast : false
275
+ matrix :
276
+ os :
277
+ - ubuntu-24.04
278
+ - ubuntu-24.04-arm
279
+ runs-on : ${{ matrix.os }}
270
280
env :
271
281
DOCKERHUB_IMAGE_NAME : seonbi
272
282
outputs :
273
283
image-ghcr : ghcr.io/${{ github.repository }}/bin@${{ steps.push-image.outputs.digest }}
274
284
image-dockerhub : docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}@${{ steps.push-image.outputs.digest }}
285
+ tag : ${{ steps.values.outputs.tag }}
286
+ labels : ${{ steps.values.outputs.labels }}
287
+ arch : ${{ steps.values.outputs.arch }}
275
288
steps :
276
289
- uses : actions/checkout@v4
277
290
with :
@@ -303,6 +316,11 @@ jobs:
303
316
else
304
317
echo labels= >> "$GITHUB_OUTPUT"
305
318
fi
319
+ if [[ "$RUNNER_ARCH" = "ARM64" ]]; then
320
+ echo arch=arm64 >> "$GITHUB_OUTPUT"
321
+ else
322
+ echo arch=amd64 >> "$GITHUB_OUTPUT"
323
+ fi
306
324
- id : push-image
307
325
uses : docker/build-push-action@v6
308
326
with :
@@ -313,10 +331,23 @@ jobs:
313
331
org.opencontainers.image.url=${{ github.event.repository.html_url }}
314
332
${{ steps.values.outputs.labels }}
315
333
tags : |
316
- ghcr.io/${{ github.repository }}/bin:${{ steps.values.outputs.tag }}
317
- ${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.values.outputs.tag }}
334
+ ghcr.io/${{ github.repository }}/bin:${{ steps.values.outputs.tag }}-${{ steps.values.outputs.arch }}
335
+ ${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.values.outputs.tag }}-${{ steps.values.outputs.arch }}
318
336
provenance : false # https://community.fly.io/t/deploying-to-fly-via-github-action-failing/10171/33
319
337
338
+ image-manifest :
339
+ name : Create and push manifest images
340
+ if : github.event_name != 'pull_request'
341
+ needs :
342
+ - image
343
+ runs-on : ubuntu-24.04
344
+ steps :
345
+ -
uses :
Noelware/[email protected]
346
+ with :
347
+ inputs : ${{ needs.image.outputs.tag }}
348
+ images : ${{ needs.image.outputs.tag }}-amd64,${{ needs.image.outputs.tag }}-arm64
349
+ push : true
350
+
320
351
fly :
321
352
name : Deploy seonbi-api to Fly.io
322
353
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -325,7 +356,7 @@ jobs:
325
356
env :
326
357
FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
327
358
IMAGE : ${{ needs.image.outputs.image-ghcr }}
328
- runs-on : ubuntu-22 .04
359
+ runs-on : ubuntu-24 .04
329
360
steps :
330
361
- uses : actions/checkout@v4
331
362
- uses : superfly/flyctl-actions/setup-flyctl@master
@@ -345,16 +376,16 @@ jobs:
345
376
needs :
346
377
- build
347
378
- image
348
- runs-on : ubuntu-22 .04
379
+ runs-on : ubuntu-24 .04
349
380
steps :
350
381
- uses : actions/checkout@v4
351
382
- uses : actions/download-artifact@v4
352
383
with :
353
- name : binaries-macos-13-xlarge -ghc-9.4
384
+ name : binaries-macos-14 -ghc-9.4
354
385
path : /tmp/binaries-macos-arm64
355
386
- uses : actions/download-artifact@v4
356
387
with :
357
- name : binaries-macos-12 -ghc-9.4
388
+ name : binaries-macos-13 -ghc-9.4
358
389
path : /tmp/binaries-macos-x86_64
359
390
- uses : actions/download-artifact@v4
360
391
with :
@@ -363,18 +394,30 @@ jobs:
363
394
- run : |
364
395
set -e
365
396
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
397
+ # Linux (amd64)
398
+ docker pull "$IMAGE-amd64 "
399
+ mkdir -p /tmp/binaries-linux-amd64
400
+ docker run -i "$IMAGE-amd64 " cat /usr/local/bin/seonbi \
401
+ > /tmp/binaries-linux-amd64 /seonbi
402
+ docker run -i "$IMAGE-amd64 " cat /usr/local/bin/seonbi-api \
403
+ > /tmp/binaries-linux-amd64 /seonbi-api
404
+ pushd /tmp/binaries-linux-amd64
374
405
chmod +x *
375
406
cp "$GITHUB_WORKSPACE/"{LICENSE,README.md,CHANGES.md} ./
376
407
tar cvfj /tmp/dists/seonbi.linux-x86_64.tar.bz2 *
377
408
popd
409
+ # Linux (arm64)
410
+ docker pull "$IMAGE-arm64"
411
+ mkdir -p /tmp/binaries-linux-arm64
412
+ docker run -i "$IMAGE-arm64" cat /usr/local/bin/seonbi \
413
+ > /tmp/binaries-linux-arm64/seonbi
414
+ docker run -i "$IMAGE-arm64" cat /usr/local/bin/seonbi-api \
415
+ > /tmp/binaries-linux-arm64/seonbi-api
416
+ pushd /tmp/binaries-linux-arm64
417
+ chmod +x *
418
+ cp "$GITHUB_WORKSPACE/"{LICENSE,README.md,CHANGES.md} ./
419
+ tar cvfj /tmp/dists/seonbi.linux-arm64.tar.bz2 *
420
+ popd
378
421
# macOS (Apple silicon)
379
422
pushd /tmp/binaries-macos-arm64
380
423
chmod +x *
@@ -404,12 +447,12 @@ jobs:
404
447
needs :
405
448
- build
406
449
- binaries
407
- runs-on : ubuntu-22 .04
450
+ runs-on : ubuntu-24 .04
408
451
steps :
409
452
- uses : actions/checkout@v4
410
453
- uses : actions/download-artifact@v4
411
454
with :
412
- name : sdist-ubuntu-22 .04-ghc-9.4
455
+ name : sdist-ubuntu-24 .04-ghc-9.4
413
456
path : /tmp/sdist
414
457
- uses : actions/download-artifact@v4
415
458
with :
@@ -458,7 +501,7 @@ jobs:
458
501
if : >-
459
502
github.event_name != 'pull_request' &&
460
503
github.ref == 'refs/heads/main'
461
- runs-on : ubuntu-22 .04
504
+ runs-on : ubuntu-24 .04
462
505
steps :
463
506
- uses : actions/checkout@v4
464
507
- uses : actions/download-artifact@v4
0 commit comments