Skip to content

Commit 8cf20ed

Browse files
Changes to release workflow (#7711)
* Changes to release workflow - Workflow environment variable changed to RELEASE_VERSION instead of RELEASE_NAME to make it more meaningful - Workflows draft-release and docker-promote previously trigger workflow container-verify. This can result in trigger is successful but actual verification workflow fails. This will not be reflected in the draft-release and docker-promote workflows. Container verify code is embedded in the draft-release and docker-promote workflows to avoid this confusion Signed-off-by: Chaminda Divitotawela <cdivitotawela@gmail.com> * PR comment improvements Signed-off-by: Chaminda Divitotawela <cdivitotawela@gmail.com> * Match the only tags starting with word latest for latest check Signed-off-by: Chaminda Divitotawela <cdivitotawela@gmail.com> --------- Signed-off-by: Chaminda Divitotawela <cdivitotawela@gmail.com> Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
1 parent f4dc48d commit 8cf20ed

File tree

3 files changed

+139
-87
lines changed

3 files changed

+139
-87
lines changed

.github/workflows/BesuContainerVerify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ else
5757
fi
5858

5959
# For the latest tag check the version match
60-
if [[ ${TAG} == "latest" && ${CHECK_LATEST} == "true" ]]
60+
if [[ ${TAG} =~ ^latest && ${CHECK_LATEST} == "true" ]]
6161
then
6262
_VERSION_IN_LOG=$(docker logs ${CONTAINER_NAME} | grep "#" | grep "Besu version" | cut -d " " -f 4 | sed 's/\s//g')
6363
echo "Extracted version from logs [$_VERSION_IN_LOG]"

.github/workflows/docker-promote.yml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ jobs:
1414
validate:
1515
runs-on: ubuntu-22.04
1616
env:
17-
RELEASE_NAME: "${{ github.event.release.name }}"
17+
RELEASE_VERSION: "${{ github.event.release.name }}"
1818
steps:
1919
- name: Pre-process Release Name
20-
id: pre_process_release_name
20+
id: pre_process_release_version
2121
run: |
2222
# strip all whitespace
23-
RELEASE_NAME="${RELEASE_NAME//[[:space:]]/}"
24-
if [[ ! "$RELEASE_NAME" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?(-.*)?$ ]]; then
23+
RELEASE_VERSION="${RELEASE_VERSION//[[:space:]]/}"
24+
if [[ ! "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?(-.*)?$ ]]; then
2525
echo "Release name does not conform to a valid besu release format YY.M.v[-suffix], e.g. 24.8.0-RC1."
2626
exit 1
2727
fi
28-
echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT # Set as output using the new syntax
28+
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT # Set as output using the new syntax
2929
outputs:
30-
release_name: ${{ steps.pre_process_release_name.outputs.release_name }}
30+
release_version: ${{ steps.pre_process_release_version.outputs.release_version }}
3131

3232
docker-promote:
3333
needs: [validate]
3434
env:
35-
RELEASE_NAME: ${{ needs.validate.outputs.release_name }} # Use the output from the pre_process_release job
35+
RELEASE_VERSION: ${{ needs.validate.outputs.release_version }}
3636
runs-on: ubuntu-22.04
3737
steps:
3838
- name: Checkout
@@ -58,24 +58,52 @@ jobs:
5858
cache-disabled: true
5959

6060
- name: Docker upload
61-
run: ./gradlew "-Prelease.releaseVersion=${{ env.RELEASE_NAME }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" dockerUploadRelease
61+
run: ./gradlew "-Prelease.releaseVersion=${{ env.RELEASE_VERSION }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" dockerUploadRelease
6262

6363
- name: Docker manifest
64-
run: ./gradlew "-Prelease.releaseVersion=${{ env.RELEASE_NAME }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" manifestDockerRelease
64+
run: ./gradlew "-Prelease.releaseVersion=${{ env.RELEASE_VERSION }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" manifestDockerRelease
6565

6666
docker-verify:
67-
needs: [validate, docker-promote]
67+
needs: [validate,docker-promote]
6868
env:
69-
RELEASE_NAME: ${{ needs.validate.outputs.release_name }} # Use the output from the pre_process_release job
70-
runs-on: ubuntu-22.04
71-
permissions:
72-
contents: read
73-
actions: write
69+
CONTAINER_NAME: besu-check
70+
RELEASE_VERSION: ${{ needs.validate.outputs.release_version }}
71+
runs-on: ${{ matrix.combination.runner }}
72+
timeout-minutes: 4
73+
strategy:
74+
matrix:
75+
combination:
76+
- tag: latest-amd64
77+
platform: 'linux/amd64'
78+
runner: ubuntu-22.04
79+
- tag: latest
80+
platform: ''
81+
runner: ubuntu-22.04
82+
- tag: latest-arm64
83+
platform: ''
84+
runner: besu-arm64
85+
- tag: latest
86+
platform: ''
87+
runner: besu-arm64
88+
7489
steps:
7590
- name: Checkout
7691
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
92+
with:
93+
sparse-checkout: '.github/workflows/BesuContainerVerify.sh'
7794

78-
- name: Trigger container verify
79-
run: echo '{"version":"${{ env.RELEASE_NAME }}","verify-latest-version":"true"}' | gh workflow run container-verify.yml --json
95+
- name: Start container
96+
run: |
97+
PLATFORM_OPT=""
98+
[[ x${{ matrix.combination.platform }} != 'x' ]] && PLATFORM_OPT="--platform ${{ matrix.combination.platform }}"
99+
docker run -d $PLATFORM_OPT --name ${{ env.CONTAINER_NAME }} ${{ secrets.DOCKER_ORG }}/besu:${{ matrix.combination.tag }}
100+
101+
- name: Verify besu container
102+
run: bash .github/workflows/BesuContainerVerify.sh
80103
env:
81-
GH_TOKEN: ${{ github.token }}
104+
TAG: ${{ matrix.combination.tag }}
105+
VERSION: ${{ env.RELEASE_VERSION }}
106+
CHECK_LATEST: true
107+
108+
- name: Stop container
109+
run: docker stop ${{ env.CONTAINER_NAME }}

0 commit comments

Comments
 (0)