Skip to content

Commit 5a458d9

Browse files
committed
Updating workflow for #ts image
Uses arm64 build hosts to fix our four-hour build problem.
1 parent 6626753 commit 5a458d9

File tree

6 files changed

+71
-9
lines changed

6 files changed

+71
-9
lines changed

.github/workflows/texer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
tagRegex: "(${{ env.IMAGE_VERSION_PREFIX }}).*"
2929
- name: dryrun-build
30-
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( steps.process_event.outputs.tag, env.IMAGE_VERSION_PREFIX ) && github.event.release.prerelease ) }}
30+
if: ${{ ( github.event_name == 'pull_request' && contains(github.event.head_commit.message, '#te') ) || ( github.event_name == 'release' && startsWith( steps.process_event.outputs.tag, env.IMAGE_VERSION_PREFIX ) && github.event.release.prerelease ) }}
3131
run: docker build ./${{ env.IMAGE_NAME }}
3232
- name: build-and-push
3333
if: ${{ github.event_name == 'release' && startsWith( steps.process_event.outputs.tag, env.IMAGE_VERSION_PREFIX ) && !github.event.release.prerelease }}

.github/workflows/toolshed.yml

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ env:
1212
IMAGE_VERSION_PREFIX: ts
1313

1414
jobs:
15-
release-ts:
16-
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }}
15+
release-ts-amd64:
16+
if: ${{ ( github.event_name == 'pull_request' && contains(github.event.head_commit.message, '#ts') ) || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }}
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
2020
platform:
2121
- linux/amd64
22-
- linux/arm64
2322
steps:
2423
- name: Prepare
2524
run: |
@@ -34,10 +33,65 @@ jobs:
3433
with:
3534
images: ${{ env.REGISTRY_IMAGE }}
3635

37-
- # Add QEMU to allow building non-native containers as
38-
# part of multi-platform container builds.
39-
name: Set up QEMU
40-
uses: docker/setup-qemu-action@v3
36+
- # Setup buildx so we can do multi-platform container builds.
37+
name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Login to GHCR
41+
if: ${{ github.event_name != 'pull_request' && !github.event.release.prerelease}}
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.repository_owner }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Build and push by digest
49+
id: build
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: toolshed
53+
platforms: ${{ matrix.platform }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
tags: ${{ steps.meta.outputs.tags }}
56+
annotations: ${{ steps.meta.outputs.annotations }}
57+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name != 'pull_request' && !github.event.release.prerelease) && 'true' || 'false' }}
58+
59+
- name: Export digest
60+
if: ${{ github.event_name != 'pull_request' && !github.event.release.prerelease}}
61+
run: |
62+
mkdir -p /tmp/digests
63+
digest="${{ steps.build.outputs.digest }}"
64+
touch "/tmp/digests/${digest#sha256:}"
65+
66+
- name: Upload digest
67+
if: ${{ github.event_name != 'pull_request' && !github.event.release.prerelease }}
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: digests-${{ env.PLATFORM_PAIR }}
71+
path: /tmp/digests/*
72+
if-no-files-found: error
73+
retention-days: 1
74+
75+
release-ts-arm64:
76+
if: ${{ ( github.event_name == 'pull_request' && contains(github.event.head_commit.message, '#ts') ) || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }}
77+
runs-on: ubuntu-24.04-arm
78+
strategy:
79+
matrix:
80+
platform:
81+
- linux/arm64
82+
steps:
83+
- name: Prepare
84+
run: |
85+
platform=${{ matrix.platform }}
86+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
87+
88+
- uses: actions/checkout@v4
89+
90+
- name: Docker meta
91+
id: meta
92+
uses: docker/metadata-action@v5
93+
with:
94+
images: ${{ env.REGISTRY_IMAGE }}
4195

4296
- # Setup buildx so we can do multi-platform container builds.
4397
name: Set up Docker Buildx
@@ -58,6 +112,8 @@ jobs:
58112
context: toolshed
59113
platforms: ${{ matrix.platform }}
60114
labels: ${{ steps.meta.outputs.labels }}
115+
tags: ${{ steps.meta.outputs.tags }}
116+
annotations: ${{ steps.meta.outputs.annotations }}
61117
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name != 'pull_request' && !github.event.release.prerelease) && 'true' || 'false' }}
62118

63119
- name: Export digest

.github/workflows/toxic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
jobs:
1515
release-tx:
16-
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/tx') ) }}
16+
if: ${{ ( github.event_name == 'pull_request' && contains(github.event.head_commit.message, '#tx') ) || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/tx') ) }}
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:

texer/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ that starts with `te`, uses the Ubuntu major and minor version, and uses an mono
1010
For example `te20.4.1`will cause the Github workflow to rebuild and push the `opencyphal/texer` container with the
1111
tag `te20.4.1`.
1212

13+
When submitting a pull-request, include `#te` in the commit message to trigger the pull-request CI.
14+
1315
***PLEASE UPDATE THE TOP-LEVEL README.md FOR EACH NEW RELEASE***
1416

1517
## Manual Build and Push

toolshed/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ that starts with `ts`, uses the Ubuntu major and minor version, and uses an mono
1010
For example `ts20.4.1`will cause the Github workflow to rebuild and push the `opencyphal/toolshed` container with the
1111
tag `ts20.4.1`.
1212

13+
When submitting a pull-request, include `#ts` in the commit message to trigger the pull-request CI.
14+
1315
***PLEASE UPDATE THE TOP-LEVEL README.md FOR EACH NEW RELEASE***
1416

1517
## Manual Build and Push

toxic/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ that starts with `tx`, uses the Ubuntu major and minor version, and uses an mono
1010
For example `tx22.4.1`will cause the Github workflow to rebuild and push the `opencyphal/toxic` container with the
1111
tag `tx22.4.1`.
1212

13+
When submitting a pull-request, include `#tx` in the commit message to trigger the pull-request CI.
14+
1315
***PLEASE UPDATE THE TOP-LEVEL README.md FOR EACH NEW RELEASE***
1416

1517
## Manual Build and Push

0 commit comments

Comments
 (0)