Skip to content

Commit fea4827

Browse files
author
Pat
authored
workflows: add extra push of arch-specfic images (#7767)
Signed-off-by: Patrick Stephens <[email protected]>
1 parent 6d4ff72 commit fea4827

File tree

1 file changed

+85
-17
lines changed

1 file changed

+85
-17
lines changed

.github/workflows/staging-release.yaml

Lines changed: 85 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Checkout repository
6868
uses: actions/checkout@v3
69-
69+
7070
# Check we can download the AppVeyor build which confirms it matches the version to release as well as being a successful build
7171
- name: Get Appveyor binaries
7272
run: |
@@ -90,13 +90,13 @@ jobs:
9090
sudo apt-get update
9191
sudo apt-get install -y jq
9292
shell: bash
93-
93+
9494
# Cope with 1.9 as well as 2.0
9595
- uses: ./.github/actions/generate-package-build-matrix
9696
id: get-matrix
9797
with:
9898
ref: v${{ inputs.version }}
99-
99+
100100
# Now annotate with whether it is Yum or Apt based
101101

102102
# 1. Take packages from the staging bucket
@@ -109,7 +109,7 @@ jobs:
109109
name: S3 - update YUM packages bucket
110110
runs-on: ubuntu-22.04 # no createrepo on Ubuntu 20.04
111111
environment: release
112-
needs:
112+
needs:
113113
- staging-release-version-check
114114
- staging-release-generate-package-matrix
115115
permissions:
@@ -182,7 +182,7 @@ jobs:
182182
name: S3 - update APT packages bucket
183183
runs-on: ubuntu-latest
184184
environment: release
185-
needs:
185+
needs:
186186
- staging-release-version-check
187187
- staging-release-generate-package-matrix
188188
permissions:
@@ -215,7 +215,7 @@ jobs:
215215
shell: bash
216216
env:
217217
DISTRO: ${{ matrix.distro }}
218-
218+
219219
- name: Import GPG key for signing
220220
id: import_gpg
221221
uses: crazy-max/ghaction-import-gpg@v5
@@ -260,7 +260,7 @@ jobs:
260260
name: Update Windows and macOS packages
261261
runs-on: ubuntu-22.04
262262
environment: release
263-
needs:
263+
needs:
264264
- staging-release-version-check
265265
permissions:
266266
contents: none
@@ -297,7 +297,7 @@ jobs:
297297
name: Update top-level bucket info
298298
runs-on: ubuntu-22.04
299299
environment: release
300-
needs:
300+
needs:
301301
- staging-release-apt-packages
302302
- staging-release-yum-packages
303303
permissions:
@@ -337,7 +337,7 @@ jobs:
337337
name: S3 - update source bucket
338338
runs-on: ubuntu-latest
339339
environment: release
340-
needs:
340+
needs:
341341
- staging-release-version-check
342342
permissions:
343343
contents: read
@@ -352,7 +352,7 @@ jobs:
352352

353353
- name: Sync packages from buckets on S3
354354
run: |
355-
mkdir -p release staging
355+
mkdir -p release staging
356356
aws s3 sync "s3://${{ secrets.AWS_S3_BUCKET_RELEASE_SOURCES }}" release/ --no-progress
357357
aws s3 sync "s3://${{ secrets.AWS_S3_BUCKET_STAGING }}/source/" staging/ --no-progress
358358
env:
@@ -382,7 +382,7 @@ jobs:
382382
VERSION: ${{ github.event.inputs.version }}
383383
MAJOR_VERSION: ${{ needs.staging-release-version-check.outputs.major-version }}
384384
shell: bash
385-
385+
386386
- name: Sync to bucket on S3
387387
run: |
388388
aws s3 sync release/ "s3://${{ secrets.AWS_S3_BUCKET_RELEASE_SOURCES }}" --delete --follow-symlinks --no-progress
@@ -476,9 +476,77 @@ jobs:
476476
TAG: ${{ matrix.tag }}
477477
shell: bash
478478

479+
# Part of resolution for: https://github.com/fluent/fluent-bit/issues/7748
480+
# More recent build-push-actions may mean legacy format is not preserved so we provide arch-specific tags just in case
481+
staging-release-images-arch-specific-legacy-tags:
482+
# TODO: remove next release once we are happy this all works, for now though do not block a release
483+
continue-on-error: true
484+
#
485+
name: Release ${{ matrix.arch }} legacy format Linux container images
486+
runs-on: ubuntu-latest
487+
needs:
488+
- staging-release-images
489+
environment: release
490+
strategy:
491+
fail-fast: false
492+
matrix:
493+
arch:
494+
- amd64
495+
- arm64
496+
- arm/v7
497+
permissions:
498+
packages: write
499+
env:
500+
RELEASE_IMAGE_NAME: ${{ github.event.inputs.docker-image || secrets.DOCKERHUB_ORGANIZATION }}
501+
RELEASE_TAG: ${{ github.event.inputs.version }}
502+
steps:
503+
504+
- name: Login to Docker Hub
505+
uses: docker/login-action@v2
506+
with:
507+
username: ${{ secrets.DOCKERHUB_USERNAME }}
508+
password: ${{ secrets.DOCKERHUB_TOKEN }}
509+
510+
- name: Login to GitHub Container Registry
511+
uses: docker/login-action@v2
512+
with:
513+
registry: ghcr.io
514+
username: ${{ github.actor }}
515+
password: ${{ secrets.GITHUB_TOKEN }}
516+
517+
- name: Convert arch to tag
518+
id: get-tag
519+
run: |
520+
TAG="${RELEASE_TAG}-${{ matrix.arch }}"
521+
echo "Input value: $TAG"
522+
TAG=${TAG/\//-}
523+
echo "Using tag: $TAG"
524+
echo "tag=$TAG" >> $GITHUB_OUTPUT
525+
shell: bash
526+
527+
- name: Pull release image
528+
run: docker pull --platform='linux/${{ matrix.arch }}' "$RELEASE_IMAGE_NAME:$RELEASE_TAG"
529+
shell: bash
530+
531+
- name: Tag and push legacy format image to DockerHub
532+
run: |
533+
docker tag "$RELEASE_IMAGE_NAME:$RELEASE_TAG" docker.io/"$RELEASE_IMAGE_NAME:$TAG"
534+
docker push docker.io/"$RELEASE_IMAGE_NAME:$TAG"
535+
shell: bash
536+
env:
537+
TAG: ${{ steps.get-tag.outputs.tag }}
538+
539+
- name: Tag and push legacy format image to Github Container Registry
540+
run: |
541+
docker tag "$RELEASE_IMAGE_NAME:$RELEASE_TAG" ghcr.io/"$RELEASE_IMAGE_NAME:$TAG"
542+
docker push ghcr.io/"$RELEASE_IMAGE_NAME:$TAG"
543+
shell: bash
544+
env:
545+
TAG: ${{ steps.get-tag.outputs.tag }}
546+
479547
staging-release-images-latest-tags:
480548
# Only update latest tags for 2.1 releases
481-
if: startsWith(github.event.inputs.version, '2.1')
549+
if: startsWith(github.event.inputs.version, '2.1')
482550
name: Release latest Linux container images
483551
runs-on: ubuntu-latest
484552
needs:
@@ -599,7 +667,7 @@ jobs:
599667
permissions: write-all
600668
runs-on: ubuntu-latest
601669
environment: release
602-
needs:
670+
needs:
603671
- staging-release-images
604672
env:
605673
DH_RELEASE_IMAGE_NAME: docker.io/${{ github.event.inputs.docker-image || secrets.DOCKERHUB_ORGANIZATION }}
@@ -634,7 +702,7 @@ jobs:
634702
"$GHCR_RELEASE_IMAGE_NAME:${{ github.event.inputs.version }}" \
635703
"$GHCR_RELEASE_IMAGE_NAME:${{ github.event.inputs.version }}-debug" \
636704
"$DH_RELEASE_IMAGE_NAME:${{ github.event.inputs.version }}" \
637-
"$DH_RELEASE_IMAGE_NAME:${{ github.event.inputs.version }}-debug"
705+
"$DH_RELEASE_IMAGE_NAME:${{ github.event.inputs.version }}-debug"
638706
rm -f /tmp/my_cosign.key
639707
shell: bash
640708
env:
@@ -670,7 +738,7 @@ jobs:
670738
steps:
671739
- name: Install cosign
672740
uses: sigstore/cosign-installer@v2
673-
741+
674742
- name: Get public key and add to S3 bucket
675743
# Only run if we have a key defined
676744
if: ${{ env.COSIGN_PRIVATE_KEY }}
@@ -765,7 +833,7 @@ jobs:
765833

766834
staging-release-create-docs-pr:
767835
name: Create docs updates for new release
768-
needs:
836+
needs:
769837
- staging-release-images
770838
- staging-release-source-s3
771839
permissions:
@@ -832,7 +900,7 @@ jobs:
832900
833901
staging-release-create-version-update-pr:
834902
name: Create version update PR for new release
835-
needs:
903+
needs:
836904
- staging-release-create-release
837905
permissions:
838906
contents: write

0 commit comments

Comments
 (0)