Skip to content

Commit 38c749c

Browse files
updates for verify artifactory
Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>
1 parent 57b1c13 commit 38c749c

7 files changed

Lines changed: 98 additions & 24 deletions

File tree

.github/workflows/docker-build-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
- name: Run Docker tests
8282
env:
8383
architecture: amd64
84+
EXPECTED_VERSION: ${{ inputs.version }}
8485
run: |
8586
mkdir -p docker/reports
8687
cd docker && ./test.sh hyperledger/besu:test

.github/workflows/release.yml

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,30 @@ name: Release
33
# Job flow:
44
#
55
# build ← validate tag (X.Y.Z or X.Y.Z-RCN, inline), gradle assemble,
6-
# sha256 hashes, upload distribution artifacts (7-day retention)
6+
# sha256 hashes, upload distribution artifacts (14-day retention)
77
#
88
# docker-build-test ← checkout tag, distDockerCopy, build amd64, goss tests (no push)
99
#
1010
# draft-release ← gh release create --draft + release notes template + artifacts
11-
#
11+
#
12+
# │ ← burn in happens here
13+
#
1214
# release-gate ← environment: "release-approval" — blocks for maintainer approval
1315
#
14-
# ├────────────────────────────────┐
15-
# publish-docker publish-artifactory
16-
# (multi-arch push, (gradle artifactoryPublish)
17-
# cosign sign + attest)
18-
# └────────────────────────────────┘
19-
#
20-
# finalize-release ← gh release edit --draft=false
16+
#
17+
# publish-artifactory ← gradle artifactoryPublish)
18+
#
19+
# verify-artifactory
20+
#
21+
# publish-docker
22+
# (multi-arch push, cosign sign + attest)
23+
#
24+
# finalize-release ← gh release edit --draft=false
25+
2126

2227
on:
2328
push:
29+
# match tags X.Y.Z and X.Y.Z-RCn
2430
tags:
2531
- '[0-9]*.[0-9]*.[0-9]*'
2632

@@ -67,29 +73,29 @@ jobs:
6773
name: besu-${{ github.ref_name }}.tar.gz
6874
path: build/distributions/besu-${{ github.ref_name }}.tar.gz
6975
compression-level: 0
70-
retention-days: 7
76+
retention-days: 14
7177

7278
- name: Upload zip
7379
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
7480
with:
7581
name: besu-${{ github.ref_name }}.zip
7682
path: build/distributions/besu-${{ github.ref_name }}.zip
7783
compression-level: 0
78-
retention-days: 7
84+
retention-days: 14
7985

8086
- name: Upload tar.gz sha256
8187
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
8288
with:
8389
name: besu-${{ github.ref_name }}.tar.gz.sha256
8490
path: build/distributions/besu-${{ github.ref_name }}.tar.gz.sha256
85-
retention-days: 7
91+
retention-days: 14
8692

8793
- name: Upload zip sha256
8894
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
8995
with:
9096
name: besu-${{ github.ref_name }}.zip.sha256
9197
path: build/distributions/besu-${{ github.ref_name }}.zip.sha256
92-
retention-days: 7
98+
retention-days: 14
9399

94100
docker-build-test:
95101
needs: build
@@ -152,16 +158,6 @@ jobs:
152158
steps:
153159
- run: echo "Release ${{ github.ref_name }} approved"
154160

155-
publish-docker:
156-
needs: release-gate
157-
permissions:
158-
id-token: write
159-
uses: ./.github/workflows/docker-publish.yml
160-
with:
161-
version: ${{ github.ref_name }}
162-
cache_scope: release-build
163-
secrets: inherit
164-
165161
publish-artifactory:
166162
needs: release-gate
167163
runs-on: ubuntu-latest
@@ -188,8 +184,38 @@ jobs:
188184
ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY_TOKEN }}
189185
run: ./gradlew -Prelease.releaseVersion=${{ github.ref_name }} -Pversion=${{ github.ref_name }} artifactoryPublish
190186

187+
verify-artifactory:
188+
runs-on: ubuntu-latest
189+
needs: publish-artifactory
190+
steps:
191+
- name: checkout
192+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
193+
with:
194+
ref: ${{ github.ref_name }}
195+
196+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
197+
with:
198+
python-version: '3.13'
199+
200+
- name: Install dependencies
201+
run: pip install requests argparse
202+
203+
- name: Run the script
204+
run: python3 .github/scripts/verifyArtifacts.py --besu_version="${{ github.ref_name }}"
205+
206+
publish-docker:
207+
needs: [release-gate, publish-artifactory, verify-artifactory]
208+
permissions:
209+
id-token: write
210+
uses: ./.github/workflows/docker-publish.yml
211+
with:
212+
version: ${{ github.ref_name }}
213+
cache_scope: release-build
214+
secrets: inherit
215+
216+
191217
finalize-release:
192-
needs: [publish-docker, publish-artifactory]
218+
needs: [publish-docker, publish-artifactory, verify-artifactory]
193219
runs-on: ubuntu-latest
194220
permissions:
195221
contents: write

docker/test.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,25 @@ bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 -v besu-data
6363
--network=dev \
6464
> ./reports/02.xml
6565

66+
# Test that Besu container started and entered main loop
67+
echo "Running test 03: Besu container started and entered main loop"
68+
GOSS_FILES_PATH=$TEST_PATH/03 \
69+
bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 $DOCKER_IMAGE \
70+
--network=dev \
71+
--rpc-http-enabled \
72+
> ./reports/03.xml
73+
74+
# Test that Besu version matches expected version (only when EXPECTED_VERSION is explicitly set)
75+
if [ -n "$EXPECTED_VERSION" ]; then
76+
echo "Running test 04: Besu version is correct"
77+
GOSS_FILES_PATH=$TEST_PATH/04 \
78+
bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 \
79+
-e EXPECTED_VERSION=$EXPECTED_VERSION \
80+
$DOCKER_IMAGE \
81+
--network=dev \
82+
> ./reports/04.xml
83+
else
84+
echo "Skipping test 04: EXPECTED_VERSION not set"
85+
fi
86+
6687
echo "All tests passed successfully"

docker/tests/03/goss.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Verify Besu container started and entered main loop
3+
process:
4+
java:
5+
running: true
6+
http:
7+
http://localhost:8545/liveness:
8+
status: 200

docker/tests/03/goss_wait.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
# Wait for Besu liveness endpoint to confirm main loop is up
3+
http:
4+
http://localhost:8545/liveness:
5+
status: 200

docker/tests/04/goss.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# Verify Besu version matches expected VERSION env var
3+
command:
4+
check-besu-version:
5+
exec: "sh -c '[ -n \"${EXPECTED_VERSION}\" ] && /opt/besu/bin/besu --version 2>&1 | grep -q \"${EXPECTED_VERSION}\"'"
6+
exit-status: 0

docker/tests/04/goss_wait.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# Wait for Besu to enter the main loop before checking version
3+
port:
4+
tcp:30303:
5+
listening: true
6+
ip:
7+
- 0.0.0.0

0 commit comments

Comments
 (0)