Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 0 additions & 179 deletions .github/workflows/oci-arm64-make.yaml

This file was deleted.

132 changes: 39 additions & 93 deletions .github/workflows/oci-make.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# https://github.com/marketplace/actions/build-and-push-docker-images
# When changing the OTP version, make sure to update all references:
# - the default in workflow_dispatch
# - otp_version in both jobs
#
#
name: OCI (make)
on:
push:
Expand All @@ -9,13 +13,27 @@ on:
- '.github/workflows/release-alphas.yaml'
- '*.md'
workflow_dispatch:
inputs:
otp_version:
# a tag of the erlang image, see https://hub.docker.com/_/erlang for available tags
# also used in the setup-beam step (same tag should work for both)
description: OTP version (eg. `26`, `26.2.5.6`)
default: 27
build_arm:
description: Build for ARM64 as well?
type: boolean
default: false
env:
REGISTRY_IMAGE: pivotalrabbitmq/rabbitmq
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-package-generic-unix:
strategy:
matrix:
otp_version:
- ${{ github.event.inputs.otp_version || '27' }}
runs-on: ubuntu-latest
outputs:
authorized: ${{ steps.authorized.outputs.authorized }}
Expand All @@ -35,43 +53,35 @@ jobs:
if: steps.authorized.outputs.authorized == 'true'
uses: erlef/setup-beam@v1
with:
otp-version: 26.2
elixir-version: 1.15
otp-version: ${{ matrix.otp_version }}
elixir-version: latest
- name: make package-generic-unix
if: steps.authorized.outputs.authorized == 'true'
run: |
make package-generic-unix PROJECT_VERSION=4.1.0-alpha.1
- name: Upload package-generic-unix
if: steps.authorized.outputs.authorized == 'true'
uses: actions/upload-artifact@v4.3.1
uses: actions/upload-artifact@v4
with:
name: package-generic-unix
name: package-generic-unix-otp${{ matrix.otp_version }}
path: PACKAGES/rabbitmq-server-*.tar.xz

build:
needs: build-package-generic-unix
runs-on: ubuntu-latest
if: ${{ needs.build-package-generic-unix.outputs.authorized }} == 'true'
build-and-push:
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
# Unfortunately even with type=gha cache, OpenSSL and OTP
# are rebuilt often and it takes ~90 minutes to do that
# in the emulated ARM mode. Disabling until we have a better solution.
#- linux/arm64
otp_version:
- ${{ github.event.inputs.otp_version || '27' }}
needs: build-package-generic-unix
runs-on: ubuntu-latest
if: ${{ needs.build-package-generic-unix.outputs.authorized }} == 'true'
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Download package-generic-unix
uses: actions/download-artifact@v4
with:
name: package-generic-unix
name: package-generic-unix-otp${{ matrix.otp_version }}
path: PACKAGES
- name: Rename package-generic-unix
run: |
Expand All @@ -83,6 +93,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
suffix=-otp${{ matrix.otp_version }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -91,12 +103,6 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -106,71 +112,11 @@ jobs:
id: build
uses: docker/build-push-action@v6
with:
push: true
context: packaging/docker-image
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha
cache-from: type=gha
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
needs:
- build
runs-on: ubuntu-latest
if: ${{ needs.build-package-generic-unix.outputs.authorized }} == 'true'
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,format=long
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

summary-oci:
needs:
- build-package-generic-unix
- build
- merge
runs-on: ubuntu-latest
steps:
- name: SUMMARY
run: |
cat << 'EOF' | jq -e 'map(.result == "success") | all(.)'
${{ toJson(needs) }}
EOF
platforms: ${{ github.event.inputs.build_arm && 'linux/amd64, linux/arm64' || 'linux/amd64' }}
tags: ${{ steps.meta.outputs.tags }}
cache-to: type=gha,mode=max,scope=${{ matrix.otp_version }}
cache-from: type=gha,scope=${{ matrix.otp_version }}
build-args:
OTP_VERSION=${{ matrix.otp_version }}
Loading
Loading