Skip to content

Commit 3031339

Browse files
committed
Add metadata-action
1 parent 96c8652 commit 3031339

File tree

3 files changed

+78
-33
lines changed

3 files changed

+78
-33
lines changed

.github/workflows/debian.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ jobs:
2424
- platform: linux/arm64
2525
runner: ubuntu-24.04-arm
2626
os:
27-
- distro: bookworm
27+
- release: bookworm
2828
compiler_name: gcc
2929
compiler_version: 12
30-
- distro: bookworm
30+
- release: bookworm
3131
compiler_name: gcc
3232
compiler_version: 13
33-
- distro: bookworm
33+
- release: bookworm
3434
compiler_name: gcc
3535
compiler_version: 14
36-
- distro: bookworm
36+
- release: bookworm
3737
compiler_name: clang
3838
compiler_version: 16
39-
- distro: bookworm
39+
- release: bookworm
4040
compiler_name: clang
4141
compiler_version: 17
42-
- distro: bookworm
42+
- release: bookworm
4343
compiler_name: clang
4444
compiler_version: 18
45-
- distro: bookworm
45+
- release: bookworm
4646
compiler_name: clang
4747
compiler_version: 19
48-
- distro: bookworm
48+
- release: bookworm
4949
compiler_name: clang
5050
compiler_version: 20
5151
runs-on: ${{ matrix.architecture.runner }}
@@ -67,10 +67,25 @@ jobs:
6767
- name: Determine the Docker image name.
6868
run: |
6969
# Convert the repository name to lowercase as the organization name is
70-
# uppercase, which is not permitted by the Docker registry.
70+
# uppercase, which is not permitted by the Docker registry. It's 2025 and GitHub
71+
# still does not provide convenient action expression syntax for lowercase.
7172
GITHUB_REPO=${{ github.repository }}
72-
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
73-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/debian-${{ matrix.os.distro }}:${{ matrix.os.compiler_name }}${{ matrix.os.compiler_version }}" >> $GITHUB_ENV
73+
CONTAINER_REPO=${GITHUB_REPO@L}
74+
echo "CONTAINER_REPOSITORY=${CONTAINER_REPO}/debian-${{ matrix.os.release }}" >> $GITHUB_ENV
75+
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPO}/debian-${{ matrix.os.release }}:" >> $GITHUB_ENV
76+
- name: Prepare container metadata
77+
id: meta
78+
uses: docker/metadata-action@v5
79+
with:
80+
images: ${{ env.CONTAINER_IMAGE }}
81+
tags: |
82+
type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}
83+
type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha-
84+
labels: |
85+
org.opencontainers.image.authors=For inquiries, please use https://github.com/XRPLF/ci/issues
86+
org.opencontainers.image.documentation=https://github.com/XRPLF/ci
87+
org.opencontainers.image.vendor=XRPLF
88+
org.opencontainers.image.title=${{ env.CONTAINER_REPOSITORY }}
7489
- name: Build and push the Docker image
7590
uses: docker/build-push-action@v6
7691
with:
@@ -79,7 +94,7 @@ jobs:
7994
BUILDKIT_INLINE_CACHE=1
8095
CLANG_VERSION=${{ matrix.os.compiler_name == 'clang' && matrix.os.compiler_version || '' }}
8196
CONAN_VERSION=${{ env.CONAN_VERSION }}
82-
DEBIAN_VERSION=${{ matrix.os.distro }}
97+
DEBIAN_VERSION=${{ matrix.os.release }}
8398
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || '' }}
8499
GITHUB_REPO=${{ github.repository }}
85100
NONROOT_USER=${{ env.NONROOT_USER }}
@@ -89,5 +104,5 @@ jobs:
89104
provenance: mode=max
90105
push: true
91106
sbom: true
92-
tags: ${{ env.CONTAINER_IMAGE }}
107+
labels: ${{ steps.meta.outputs.labels }}
93108
target: ${{ matrix.os.compiler_name }}

.github/workflows/rhel.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
- platform: linux/arm64
2727
runner: ubuntu-24.04-arm
2828
os:
29-
- distro: 9.6
29+
- release: 9.6
3030
compiler_name: gcc
3131
compiler_version: 13
32-
- distro: 9.6
32+
- release: 9.6
3333
compiler_name: gcc
3434
compiler_version: 14
35-
- distro: 9.6
35+
- release: 9.6
3636
compiler_name: clang
3737
compiler_version: ''
3838
runs-on: ${{ matrix.architecture.runner }}
@@ -60,10 +60,25 @@ jobs:
6060
- name: Determine the Docker image name.
6161
run: |
6262
# Convert the repository name to lowercase as the organization name is
63-
# uppercase, which is not permitted by the Docker registry.
63+
# uppercase, which is not permitted by the Docker registry. It's 2025 and GitHub
64+
# still does not provide convenient action expression syntax for lowercase.
6465
GITHUB_REPO=${{ github.repository }}
65-
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
66-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/rhel-${{ matrix.os.distro }}:${{ matrix.os.compiler_name }}${{ matrix.os.compiler_version }}" >> $GITHUB_ENV
66+
CONTAINER_REPO=${GITHUB_REPO@L}
67+
echo "CONTAINER_REPOSITORY=${CONTAINER_REPO}/rhel-${{ matrix.os.release }}" >> $GITHUB_ENV
68+
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPO}/rhel-${{ matrix.os.release }}:" >> $GITHUB_ENV
69+
- name: Prepare container metadata
70+
id: meta
71+
uses: docker/metadata-action@v5
72+
with:
73+
images: ${{ env.CONTAINER_IMAGE }}
74+
tags: |
75+
type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}
76+
type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha-
77+
labels: |
78+
org.opencontainers.image.authors=For inquiries, please use https://github.com/XRPLF/ci/issues
79+
org.opencontainers.image.documentation=https://github.com/XRPLF/ci
80+
org.opencontainers.image.vendor=XRPLF
81+
org.opencontainers.image.title=${{ env.CONTAINER_REPOSITORY }}
6782
- name: Build and push the Docker image
6883
uses: docker/build-push-action@v6
6984
with:
@@ -74,12 +89,12 @@ jobs:
7489
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || '' }}
7590
GITHUB_REPO=${{ github.repository }}
7691
NONROOT_USER=${{ env.NONROOT_USER }}
77-
RHEL_VERSION=${{ matrix.os.distro }}
92+
RHEL_VERSION=${{ matrix.os.release }}
7893
context: docker/rhel
7994
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
8095
platforms: ${{ matrix.architecture.platform }}
8196
provenance: mode=max
8297
push: true
8398
sbom: true
84-
tags: ${{ env.CONTAINER_IMAGE }}
99+
labels: ${{ steps.meta.outputs.labels }}
85100
target: ${{ matrix.os.compiler_name }}

.github/workflows/ubuntu.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ jobs:
2525
- platform: linux/arm64
2626
runner: ubuntu-24.04-arm
2727
os:
28-
- distro: jammy
28+
- release: jammy
2929
compiler_name: gcc
3030
compiler_version: 12
31-
- distro: noble
31+
- release: noble
3232
compiler_name: gcc
3333
compiler_version: 13
34-
- distro: noble
34+
- release: noble
3535
compiler_name: gcc
3636
compiler_version: 14
37-
- distro: noble
37+
- release: noble
3838
compiler_name: clang
3939
compiler_version: 16
40-
- distro: noble
40+
- release: noble
4141
compiler_name: clang
4242
compiler_version: 17
43-
- distro: noble
43+
- release: noble
4444
compiler_name: clang
4545
compiler_version: 18
46-
- distro: noble
46+
- release: noble
4747
compiler_name: clang
4848
compiler_version: 19
4949
runs-on: ${{ matrix.architecture.runner }}
@@ -65,10 +65,25 @@ jobs:
6565
- name: Determine the Docker image name.
6666
run: |
6767
# Convert the repository name to lowercase as the organization name is
68-
# uppercase, which is not permitted by the Docker registry.
68+
# uppercase, which is not permitted by the Docker registry. It's 2025 and GitHub
69+
# still does not provide convenient action expression syntax for lowercase.
6970
GITHUB_REPO=${{ github.repository }}
70-
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
71-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.os.distro }}:${{ matrix.os.compiler_name }}${{ matrix.os.compiler_version }}" >> $GITHUB_ENV
71+
CONTAINER_REPO=${GITHUB_REPO@L}
72+
echo "CONTAINER_REPOSITORY=${CONTAINER_REPO}/ubuntu-${{ matrix.os.release }}" >> $GITHUB_ENV
73+
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPO}/ubuntu-${{ matrix.os.release }}:" >> $GITHUB_ENV
74+
- name: Prepare container metadata
75+
id: meta
76+
uses: docker/metadata-action@v5
77+
with:
78+
images: ${{ env.CONTAINER_IMAGE }}
79+
tags: |
80+
type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}
81+
type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha-
82+
labels: |
83+
org.opencontainers.image.authors=For inquiries, please use https://github.com/XRPLF/ci/issues
84+
org.opencontainers.image.documentation=https://github.com/XRPLF/ci
85+
org.opencontainers.image.vendor=XRPLF
86+
org.opencontainers.image.title=${{ env.CONTAINER_REPOSITORY }}
7287
- name: Build and push the Docker image
7388
uses: docker/build-push-action@v6
7489
with:
@@ -80,12 +95,12 @@ jobs:
8095
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || '' }}
8196
GITHUB_REPO=${{ github.repository }}
8297
NONROOT_USER=${{ env.NONROOT_USER }}
83-
UBUNTU_VERSION=${{ matrix.os.distro }}
98+
UBUNTU_VERSION=${{ matrix.os.release }}
8499
context: docker/ubuntu
85100
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
86101
platforms: ${{ matrix.architecture.platform }}
87102
provenance: mode=max
88103
push: true
89104
sbom: true
90-
tags: ${{ env.CONTAINER_IMAGE }}
105+
labels: ${{ steps.meta.outputs.labels }}
91106
target: ${{ matrix.os.compiler_name }}

0 commit comments

Comments
 (0)