Skip to content

Commit 051def7

Browse files
committed
Update automated image build
1 parent c09f8a9 commit 051def7

File tree

4 files changed

+65
-60
lines changed

4 files changed

+65
-60
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,66 @@ on:
1111
push:
1212
branches:
1313
- main
14-
- staging
15-
# Publish semver tags as releases.
16-
tags: [ 'v*.*.*' ]
1714
pull_request:
1815
branches:
1916
- main
20-
- staging
2117
workflow_dispatch:
2218

2319
env:
2420
# Use docker.io for Docker Hub if empty
2521
REGISTRY: ghcr.io
2622
# github.repository as <account>/<repo>
2723
IMAGE_NAME: ${{ github.repository }}
28-
24+
RUNNER_VERSION: 2.331.0
2925

3026
jobs:
3127
build:
32-
33-
runs-on: ubuntu-latest
28+
name: ${{ matrix.tag }}
29+
runs-on: ${{ matrix.runs_on }}
3430
permissions:
3531
contents: read
3632
packages: write
3733
# This is used to complete the identity challenge
3834
# with sigstore/fulcio when running outside of PRs.
3935
id-token: write
4036
strategy:
37+
fail-fast: false
4138
matrix:
42-
ubuntu_version: [noble]
43-
arch: [s390x, aarch64, x86_64]
4439
include:
45-
- arch: s390x
46-
dockerfile: s390x.Dockerfile
47-
platform: linux/s390x
40+
- arch: x86_64
41+
dockerfile: Dockerfile
42+
platform: linux/amd64
43+
tag: main-noble-x86_64
44+
runs_on: ubuntu-latest
45+
4846
- arch: aarch64
4947
dockerfile: Dockerfile
5048
platform: linux/arm64
49+
tag: main-noble-aarch64
50+
runs_on: ubuntu-24.04-arm
51+
52+
- arch: s390x
53+
dockerfile: s390x.Dockerfile
54+
platform: linux/s390x
55+
tag: main-noble-s390x
56+
runs_on: ubuntu-latest
57+
5158
- arch: x86_64
52-
dockerfile: Dockerfile
59+
dockerfile: kbuilder-debian.Dockerfile
5360
platform: linux/amd64
61+
tag: kbuilder-debian-x86_64
62+
runs_on: ubuntu-latest
63+
64+
- arch: aarch64
65+
dockerfile: kbuilder-debian.Dockerfile
66+
platform: linux/arm64
67+
tag: kbuilder-debian-aarch64
68+
runs_on: ubuntu-24.04-arm
5469

5570
steps:
71+
5672
- name: Checkout repository
57-
uses: actions/checkout@v4
73+
uses: actions/checkout@v6
5874

5975
# Install the cosign tool except on PR
6076
# https://github.com/sigstore/cosign-installer
@@ -66,9 +82,8 @@ jobs:
6682
run: cosign version
6783

6884
- name: Set up QEMU
85+
if: matrix.arch == 's390x'
6986
uses: docker/setup-qemu-action@v3
70-
with:
71-
image: tonistiigi/binfmt:qemu-v9.2.2
7287

7388
- name: Setup Docker buildx
7489
uses: docker/setup-buildx-action@v3
@@ -83,27 +98,6 @@ jobs:
8398
username: ${{ github.actor }}
8499
password: ${{ secrets.GITHUB_TOKEN }}
85100

86-
# Extract metadata (tags, labels) for Docker
87-
# https://github.com/docker/metadata-action
88-
- name: Extract Docker metadata
89-
id: meta
90-
uses: docker/metadata-action@v5
91-
with:
92-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
93-
flavor: |
94-
latest=auto
95-
prefix=
96-
suffix=-${{ matrix.ubuntu_version }}-${{ matrix.arch }}
97-
tags: |
98-
# Generate old tag names (e.g main-s390x, main-x86_64...) when building noble
99-
# branch event
100-
type=ref,enable=${{ matrix.ubuntu_version == 'noble' }},suffix=-${{ matrix.arch }},event=branch
101-
# pr event
102-
type=ref,enable=${{ matrix.ubuntu_version == 'noble' }},prefix=pr-,suffix=-${{ matrix.arch }},event=pr
103-
# tags for all pr/branches
104-
type=ref,event=branch,enable=true,priority=600
105-
type=ref,event=pr,enable=true,prefix=pr-,priority=600
106-
107101
# Build and push Docker image with Buildx (don't push on PR)
108102
# https://github.com/docker/build-push-action
109103
- name: Build and push Docker image
@@ -113,10 +107,9 @@ jobs:
113107
context: .
114108
file: ${{ matrix.dockerfile }}
115109
push: ${{ github.event_name != 'pull_request' }}
116-
tags: ${{ steps.meta.outputs.tags }}
117-
labels: ${{ steps.meta.outputs.labels }}
110+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.tag }}
118111
platforms: ${{ matrix.platform }}
119-
build-args: UBUNTU_VERSION=${{ matrix.ubuntu_version }}
112+
build-args: RUNNER_VERSION=${{ env.RUNNER_VERSION }}
120113

121114
# Sign the resulting Docker image digest except on PRs.
122115
# This will only write to the public Rekor transparency log when the Docker
@@ -127,7 +120,6 @@ jobs:
127120
if: ${{ github.event_name != 'pull_request' }}
128121
env:
129122
COSIGN_EXPERIMENTAL: "true"
130-
TAGS: ${{ steps.meta.outputs.tags }}
131123
# This step uses the identity token to provision an ephemeral certificate
132124
# against the sigstore community Fulcio instance.
133-
run: cosign sign --yes ${TAGS}
125+
run: cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.tag }}

.github/workflows/version_bump.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: s390x version bump
1+
name: RUNNER_VERSION bump
22

33
# This workflow pulls the latest official actions runner version using GH API
4-
# and update our s390x Dockerfile.
4+
# and update RUNNER_VERSION variable.
55
# If a change happens, the change will be commited in a versioned branch and
66
# a PR will be created. Upon merging, the branch will be deleted.
77
#
@@ -14,13 +14,13 @@ on:
1414

1515
jobs:
1616
bump_version:
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-slim
1818
permissions:
1919
contents: write
2020
pull-requests: write
2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
2424

2525
- name: Get latest runner release
2626
id: release
@@ -35,14 +35,30 @@ jobs:
3535
3636
- name: Update release
3737
id: bump
38-
run: sed -i 's#^ARG RUNNER_VERSION=.*#ARG RUNNER_VERSION=${{ steps.release.outputs.ACTIONS_VERSION}}#' s390x.Dockerfile
38+
run: |
39+
sed -i 's#RUNNER_VERSION:.*#RUNNER_VERSION: ${{ steps.release.outputs.ACTIONS_VERSION }}#' .github/workflows/publish.yml
3940
4041
- name: Create Pull Request
41-
uses: peter-evans/create-pull-request@v7
42-
with:
43-
title: "[automated] s390x: bump RUNNER_VERSION to v${{ steps.release.outputs.ACTIONS_VERSION}}"
44-
commit-message: "[automated] s390x: bump RUNNER_VERSION to v${{ steps.release.outputs.ACTIONS_VERSION}}"
45-
branch: "version-bump/${{ steps.release.outputs.ACTIONS_VERSION}}"
46-
delete-branch: true
47-
body: ""
48-
reviewers: anakryiko, chantra, danielocfb, yurinnick, theihor
42+
env:
43+
GH_TOKEN: ${{ github.token }}
44+
RUNNER_VERSION: ${{ steps.release.outputs.ACTIONS_VERSION }}
45+
BRANCH: version-bump/${{ steps.release.outputs.ACTIONS_VERSION }}
46+
run: |
47+
48+
if git diff --quiet; then
49+
echo "No changes to commit"
50+
exit 0
51+
fi
52+
53+
git config user.name "github-actions[bot]"
54+
git config user.email "github-actions[bot]@users.noreply.github.com"
55+
56+
git checkout -b "${BRANCH}"
57+
git add -A
58+
git commit -m "[automated] Bump RUNNER_VERSION to v${VERSION}"
59+
git push -u origin "${BRANCH}"
60+
61+
gh pr create \
62+
--title "[automated] Bump RUNNER_VERSION to v${VERSION}" \
63+
--body "" \
64+
--reviewer anakryiko,danielocfb,theihor

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ FROM myoung34/github-runner:ubuntu-${UBUNTU_VERSION}
55
ARG UBUNTU_VERSION
66

77
COPY install-dependencies.sh /tmp/install-dependencies.sh
8-
RUN bash /tmp/install-dependencies.sh all
8+
RUN bash /tmp/install-dependencies.sh run
99

1010
COPY token.sh /token.sh
11-
12-
COPY setup-mirror-repos.sh /tmp/setup-mirror-repos.sh
13-
RUN bash /tmp/setup-mirror-repos.sh

s390x.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RUN apt-get install -y --no-install-recommends \
5252
software-properties-common sudo tar unzip wget zip zstd
5353

5454
COPY install-dependencies.sh /tmp/install-dependencies.sh
55-
RUN /tmp/install-dependencies.sh
55+
RUN /tmp/install-dependencies.sh run
5656

5757
RUN apt-get -y install aspnetcore-runtime-8.0
5858

0 commit comments

Comments
 (0)