88 - ' .github/workflows/update-otp-patches.yaml'
99 workflow_dispatch :
1010env :
11- GENERIC_UNIX_ARCHIVE : ${{ github.workspace }}/bazel-bin/package-generic-unix.tar.xz
12- RABBITMQ_VERSION : ${{ github.event.pull_request.head.sha || github.sha }}
1311 VERSION : ${{ github.event.pull_request.head.sha || github.sha }}
1412concurrency :
1513 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1614 cancel-in-progress : true
1715jobs :
18-
19- # This job will build one docker image per supported Erlang major version.
20- # Each image will have two tags (one containing the Git commit SHA, one containing the branch name).
21- #
22- # For example, for Git commit SHA '111aaa' and branch name 'main' and maximum supported Erlang major version '26',
23- # the following tags will be pushed to Dockerhub:
24- #
25- # * 111aaa-otp-min (image OTP 25)
26- # * main-otp-min (image OTP 25)
27- # * 111aaa-otp-max (image OTP 26)
28- # * main-otp-max (image OTP 26)
29-
3016 build-publish-dev-bazel :
31- runs-on : ubuntu-20.04
32- strategy :
33- fail-fast : false
34- matrix :
35- include :
36- - image_tag_suffix : otp-min-bazel
37- otp_version_id : 26_1
38- - image_tag_suffix : otp-max-bazel
39- otp_version_id : 26_2
17+ runs-on : ubuntu-latest
4018 steps :
4119 - name : Checkout
4220 uses : actions/checkout@v4
4321
44- - name : Mount Bazel Cache
45- 22+ - name : Set up QEMU
23+ uses : docker/setup-qemu-action@v3
24+
25+ - name : Set up Docker Buildx
26+ uses : docker/setup-buildx-action@v3
27+
28+ - name : Configure Erlang
29+ uses : erlef/setup-beam@v1
4630 with :
47- path : " /home/runner/repo-cache/ "
48- key : ${{ runner.os }}-repo-cache-${{ hashFiles('MODULE.bazel','WORKSPACE','bazel/bzlmod/secondary_umbrella.bzl') }}
49- restore-keys : |
50- ${{ runner.os }}-repo-cache-
51- save-always : true
31+ otp-version : 26.2
32+ elixir-version : 1.15
33+
34+ - name : Expose GitHub Runtime
35+ uses : crazy-max/ghaction-github-runtime@v3
5236
5337 - name : Configure Bazel
5438 run : |
@@ -60,35 +44,27 @@ jobs:
6044 cat << EOF >> user.bazelrc
6145 build:buildbuddy --build_metadata=ROLE=CI
6246 build:buildbuddy --build_metadata=VISIBILITY=PRIVATE
63- build:buildbuddy --repository_cache=/home/runner/repo-cache/
6447 build:buildbuddy --color=yes
65- build:buildbuddy --disk_cache=
6648
67- build:buildbuddy --remote_download_toplevel
49+ build --experimental_ui_max_stdouterr_bytes=4194304
50+ build --action_env EXTRA_BUILDX_OPTS="--cache-from=type=gha --cache-to=type=gha"
6851 EOF
6952
70- - name : Configure otp for the OCI image
53+ - name : Build amd64
7154 run : |
72- sudo npm install --global --silent @bazel/buildozer
73-
74- buildozer 'set tars ["@otp_src_${{ matrix.otp_version_id }}//file"]' \
75- //packaging/docker-image:otp_source
55+ bazelisk build //packaging/docker-image:rabbitmq-amd64 \
56+ --config=buildbuddy
7657
77- - name : Build
58+ - name : Build arm64
7859 run : |
79- bazelisk build //packaging/docker-image:rabbitmq \
80- --config=rbe-${{ matrix.otp_version_id }}
60+ bazelisk build //packaging/docker-image:rabbitmq-arm64 \
61+ --config=buildbuddy
8162
8263 - name : Test
8364 run : |
8465 OCI_TESTS=$(bazel cquery 'tests(//packaging/docker-image/...)' | awk '{ print $1 }')
8566 bazelisk test ${OCI_TESTS} \
86- --config=rbe-${{ matrix.otp_version_id }}
87-
88- - name : Load
89- run : |
90- bazelisk run //packaging/docker-image:rabbitmq \
91- --config=rbe-${{ matrix.otp_version_id }}
67+ --config=buildbuddy
9268
9369 - name : Check for Push Credentials
9470 id : authorized
9975 echo "PUSH=false" >> $GITHUB_OUTPUT
10076 fi
10177
78+ - name : Assemble Multi-Arch
79+ run : |
80+ bazelisk build //packaging/docker-image:rabbitmq \
81+ --config=buildbuddy
82+
10283 - name : Login to DockerHub
10384 if : steps.authorized.outputs.PUSH == 'true'
10485 uses : docker/login-action@v3
@@ -109,16 +90,16 @@ jobs:
10990 - name : Tag and Push
11091 if : steps.authorized.outputs.PUSH == 'true'
11192 run : |
112- TAG_1="${{ github.event.pull_request.head.sha || github.sha }}-${{ matrix.image_tag_suffix }}"
113- TAG_2="${GITHUB_REF##*/}-${{ matrix.image_tag_suffix }}"
93+ TAG_1="${{ env.VERSION }}"
11494
115- docker tag bazel/packaging/docker-image:rabbitmq \
116- pivotalrabbitmq/rabbitmq:${TAG_1}
117- docker tag bazel/packaging/docker-image:rabbitmq \
118- pivotalrabbitmq/rabbitmq:${TAG_2}
95+ REF_NAME="${{ github.ref_name }}"
96+ TAG_2="${REF_NAME//\//-}"
11997
120- docker push pivotalrabbitmq/rabbitmq:${TAG_1}
121- docker push pivotalrabbitmq/rabbitmq:${TAG_2}
98+ set -x
99+ bazelisk run //packaging/docker-image:push \
100+ --config=buildbuddy -- \
101+ --tag ${TAG_1} \
102+ --tag ${TAG_2}
122103
123104 summary-oci :
124105 needs :
0 commit comments