Skip to content

Commit f65b7a8

Browse files
committed
Use branch latest sha in nightly OCI
Instead of the SHA from the GitHub context, which returns the SHA from the cloned repository (so always main). The SHA from main then ends up in the broker version, which is confusing for other branches.
1 parent 656a4bf commit f65b7a8

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

.github/workflows/oci-make-nightly.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
otp_version:
2222
- '27'
2323
branch:
24-
- main
24+
# - main
2525
- v4.2.x
26-
- v4.1.x
27-
- v4.0.x
28-
include:
29-
- branch: main
30-
project_version: 4.3.0
26+
# - v4.1.x
27+
# - v4.0.x
28+
# include:
29+
# - branch: main
30+
# project_version: 4.3.0
3131

3232
runs-on: ubuntu-latest
3333
steps:
@@ -39,14 +39,21 @@ jobs:
3939
fetch-depth: 0
4040
filter: blob:none
4141

42-
- name: Determine closes tag
42+
- name: Determine closest tag
4343
id: tag
4444
if: matrix.branch != 'main'
4545
shell: bash
4646
run: |
4747
t=$(git describe --tags --abbrev=0 ${{ matrix.branch }})
4848
printf "project_version=%s\n" "${t:1}" | tee -a "$GITHUB_OUTPUT"
4949
50+
- name: Get current SHA
51+
id: sha
52+
shell: bash
53+
run: |
54+
sha=$(git rev-parse HEAD)
55+
printf "current_sha=%s\n" "$t" | tee -a "$GITHUB_OUTPUT"
56+
5057
- name: Configure Erlang
5158
uses: erlef/setup-beam@v1
5259
with:
@@ -56,7 +63,7 @@ jobs:
5663
- name: make package-generic-unix
5764
id: make
5865
run: |
59-
make package-generic-unix PROJECT_VERSION=${{ matrix.project_version || steps.tag.outputs.project_version }}+${{ github.sha }}
66+
make package-generic-unix PROJECT_VERSION=${{ matrix.project_version || steps.tag.outputs.project_version }}+${{ steps.sha.outputs.current_sha }}
6067
6168
- name: Upload package-generic-unix
6269
uses: actions/upload-artifact@v4
@@ -71,10 +78,10 @@ jobs:
7178
otp_version:
7279
- '27'
7380
branch:
74-
- main
81+
# - main
7582
- v4.2.x
76-
- v4.1.x
77-
- v4.0.x
83+
# - v4.1.x
84+
# - v4.0.x
7885

7986
needs: build-package-generic-unix
8087
runs-on: ubuntu-latest
@@ -84,6 +91,13 @@ jobs:
8491
with:
8592
ref: ${{ matrix.branch }}
8693

94+
- name: Get current SHA
95+
id: sha
96+
shell: bash
97+
run: |
98+
sha=$(git rev-parse HEAD)
99+
printf "current_sha=%s\n" "$t" | tee -a "$GITHUB_OUTPUT"
100+
87101
- name: Download package-generic-unix
88102
uses: actions/download-artifact@v5
89103
with:
@@ -133,4 +147,4 @@ jobs:
133147
cache-from: type=gha,scope=${{ matrix.otp_version }}
134148
build-args: |
135149
OTP_VERSION=${{ matrix.otp_version }}
136-
RABBITMQ_VERSION=${{ matrix.branch }}+${{ github.sha }}
150+
RABBITMQ_VERSION=${{ matrix.branch }}+${{ steps.sha.outputs.current_sha }}

0 commit comments

Comments
 (0)