Skip to content

Commit 6c1830c

Browse files
Patrick Stephensedsiper
authored andcommitted
workflows: sync major version of container images
Signed-off-by: Patrick Stephens <[email protected]>
1 parent 64d58cc commit 6c1830c

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/staging-release.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
name: Check staging release matches
3131
environment: release
3232
runs-on: ubuntu-latest
33+
outputs:
34+
major-version: ${{ steps.get_major_version.outputs.value }}
3335
steps:
3436
- name: Get the version on staging
3537
run: |
@@ -44,6 +46,19 @@ jobs:
4446
AWS_URL: https://${{ secrets.AWS_S3_BUCKET_STAGING }}.s3.amazonaws.com
4547
RELEASE_VERSION: ${{ github.event.inputs.version }}
4648

49+
# Get the major version, i.e. 1.9.3 --> 1.9, or just return the passed in version.
50+
- name: Convert to major version format
51+
id: get_major_version
52+
run: |
53+
MAJOR_VERSION="$RELEASE_VERSION"
54+
if [[ $RELEASE_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
55+
MAJOR_VERSION="${BASH_REMATCH[0]}"
56+
fi
57+
echo "::set-output name=value::$MAJOR_VERSION"
58+
shell: bash
59+
env:
60+
RELEASE_VERSION: ${{ github.event.inputs.version }}
61+
4762
# 1. Take packages from the staging bucket
4863
# 2. Sign them with the release GPG key
4964
# 3. Also take existing release packages from the release bucket.
@@ -141,16 +156,25 @@ jobs:
141156
# Simple skopeo copy jobs to transfer image from staging to release registry with optional GPG key signing.
142157
# Unfortunately skopeo currently does not support Cosign: https://github.com/containers/skopeo/issues/1533
143158
staging-release-images:
159+
name: Release ${{ matrix.tag }} container images
144160
runs-on: ubuntu-latest
145-
needs: staging-release-version-check
161+
needs:
162+
- staging-release-version-check
146163
environment: release
147164
env:
148165
STAGING_IMAGE_NAME: ghcr.io/${{ github.repository }}/staging
149166
strategy:
150167
fail-fast: false
151168
matrix:
152169
# All the explicit tags we want to release
153-
tag: [ "${{ github.event.inputs.version }}", "latest", "${{ github.event.inputs.version }}-debug", "latest-debug" ]
170+
tag: [
171+
"${{ github.event.inputs.version }}",
172+
"${{ needs.staging-release-version-check.outputs.major-version }}",
173+
"latest",
174+
"${{ github.event.inputs.version }}-debug",
175+
"${{ needs.staging-release-version-check.outputs.major-version }}-debug",
176+
"latest-debug"
177+
]
154178
steps:
155179
# Primarily because the skopeo errors are hard to parse and non-obvious
156180
- name: Check the image exists

0 commit comments

Comments
 (0)