Skip to content

Commit c14c02c

Browse files
authored
.github: Add ARM64 CI and deployment (#39)
* .github: Add ARM64 CI and deployment * Update release process to use multiple instances
1 parent d970886 commit c14c02c

File tree

2 files changed

+63
-8
lines changed

2 files changed

+63
-8
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
autoconf_version: ["2.71", "2.72"]
34-
runs-on: ubuntu-latest
34+
os: [ubuntu-latest, ubuntu-24.04-arm]
35+
runs-on: ${{ matrix.os }}
3536
env:
3637
TAG: autoconf:${{ matrix.autoconf_version }}-${{ github.run_id }}
3738
steps:

.github/workflows/release.yml

+61-7
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,27 @@ on:
1515
run-name: "Release: ${{ inputs.package }}"
1616

1717
jobs:
18-
release-to-ghcr:
18+
generate-version:
1919
concurrency:
2020
group: release-to-ghcr-${{ inputs.package }}
2121
cancel-in-progress: false
2222
if: contains('["brettcannon", "corona10", "erlend-aasland"]', github.actor)
2323
runs-on: ubuntu-latest
24+
outputs:
25+
builddate: ${{ steps.version.outputs.version }}
2426
steps:
2527
# Checkout push-to-registry action github repository
2628
- name: Set Calver Date
2729
run: |
2830
echo "builddate=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
2931
id: version
30-
- name: Checkout Push to Registry action
32+
33+
build_amd64:
34+
needs: generate-version
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
3138
uses: actions/checkout@v4
32-
- name: Set up QEMU
33-
uses: docker/setup-qemu-action@v3
3439
- name: Set up Docker Buildx
3540
uses: docker/setup-buildx-action@v3
3641
- name: Login To GHCR
@@ -43,8 +48,57 @@ jobs:
4348
uses: docker/build-push-action@v6
4449
with:
4550
context: ./${{ inputs.package }}
46-
platforms: linux/amd64,linux/arm64
51+
platforms: linux/amd64
4752
push: true
4853
tags: |
49-
ghcr.io/python/${{ inputs.package }}:${{ steps.version.outputs.builddate }}.${{ github.run_id }}
50-
ghcr.io/python/${{ inputs.package }}:latest
54+
ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}-amd64
55+
56+
build_arm64:
57+
needs: generate-version
58+
runs-on: ubuntu-24.04-arm
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
- name: Set up Docker Buildx
63+
uses: docker/setup-buildx-action@v3
64+
- name: Login To GHCR
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
- name: Build and push
71+
uses: docker/build-push-action@v6
72+
with:
73+
context: ./${{ inputs.package }}
74+
platforms: linux/arm64
75+
push: true
76+
tags: |
77+
ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}-arm64
78+
79+
set_manifest:
80+
needs: [generate-version, build_amd64, build_arm64]
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
- name: Set up Docker Buildx
86+
uses: docker/setup-buildx-action@v3
87+
- name: Login To GHCR
88+
uses: docker/login-action@v3
89+
with:
90+
registry: ghcr.io
91+
username: ${{ github.actor }}
92+
password: ${{ secrets.GITHUB_TOKEN }}
93+
- name: Set manifest
94+
run: |
95+
docker manifest create ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }} \
96+
--amend ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}-amd64 \
97+
--amend ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}-arm64
98+
99+
docker manifest create ghcr.io/python/${{ inputs.package }}:latest \
100+
--amend ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}-amd64 \
101+
--amend ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}-arm64
102+
103+
docker manifest push ghcr.io/python/${{ inputs.package }}:latest
104+
docker manifest push ghcr.io/python/${{ inputs.package }}:${{ needs.generate-version.outputs.builddate }}.${{ github.run_id }}

0 commit comments

Comments
 (0)