Skip to content

Commit

Permalink
add workflow to verify artifacts (#8056)
Browse files Browse the repository at this point in the history
* add workflow to verify artifacts

Signed-off-by: Joshua Fernandes <[email protected]>

* curate list of artifacts based on PR review

Signed-off-by: Joshua Fernandes <[email protected]>

* make the artifacts list simple

Signed-off-by: Joshua Fernandes <[email protected]>

---------

Signed-off-by: Joshua Fernandes <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
  • Loading branch information
joshuafernandes and macfarla authored Jan 14, 2025
1 parent b797f2e commit ff5266a
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,23 @@ jobs:
ARTIFACTORY_USER: ${{ secrets.BESU_ARTIFACTORY_USER }}
ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY_TOKEN }}
run: ./gradlew -Prelease.releaseVersion=${{ env.RELEASE_VERSION }} -Pversion=${{env.RELEASE_VERSION}} artifactoryPublish

verify_artifactory:
runs-on: ubuntu-22.04
needs: [artifactory, validate, test-linux, test-windows]
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ env.RELEASE_VERSION }}

# actions/[email protected]
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.13'

- name: Install dependencies
run: pip install requests argparse

- name: Run the script
run: python3 .github/workflows/verify_artifacts.py --besu_version="${{ needs.validate.outputs.release_version }}"
55 changes: 55 additions & 0 deletions .github/workflows/verify_artifacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import requests
import argparse


def create_artifact_paths(version):
artifacts_base_path = "https://hyperledger.jfrog.io/hyperledger/besu-maven/org/hyperledger/besu"
# add to this list here to update the list of artifacts to check
artifacts = [
# besu/evm
f"{artifacts_base_path}/evm/{version}/evm-{version}.module",
f"{artifacts_base_path}/evm/{version}/evm-{version}.pom",
f"{artifacts_base_path}/evm/{version}/evm-{version}.jar",
# besu/plugin-api
f"{artifacts_base_path}/plugin-api/{version}/plugin-api-{version}.module",
f"{artifacts_base_path}/plugin-api/{version}/plugin-api-{version}.pom",
f"{artifacts_base_path}/plugin-api/{version}/plugin-api-{version}.jar",
# besu/metrics-core
f"{artifacts_base_path}/internal/metrics-core/{version}/metrics-core-{version}.module",
f"{artifacts_base_path}/internal/metrics-core/{version}/metrics-core-{version}.pom",
f"{artifacts_base_path}/internal/metrics-core/{version}/metrics-core-{version}.jar",
# besu/internal/core
f"{artifacts_base_path}/internal/core/{version}/core-{version}.module",
f"{artifacts_base_path}/internal/core/{version}/core-{version}.pom",
f"{artifacts_base_path}/internal/core/{version}/core-{version}.jar",
# besu/internal/config
f"{artifacts_base_path}/internal/config/{version}/config-{version}.module",
f"{artifacts_base_path}/internal/config/{version}/config-{version}.pom",
f"{artifacts_base_path}/internal/config/{version}/config-{version}.jar"
# bom
f"{artifacts_base_path}/bom/{version}/bom-{version}.module",
f"{artifacts_base_path}/bom/{version}/bom-{version}.pom",
]
return artifacts



def check_url(url):
print(f"Checking artifact at: {url}")
r = requests.head(url)
if (r.status_code != 200):
raise Exception(f"Sorry, No artifact found at '{url}' !!!")

def main():
parser = argparse.ArgumentParser(description='Check besu artifacts')
parser.add_argument('--besu_{version}', action="store", dest='besu_{version}', default="")
args = parser.parse_args()
print(args.besu_{version})

artifacts = create_artifact_paths(args.besu_{version})
print(artifacts)
for url in artifacts:
check_url(url)

if __name__ == "__main__":
main()

0 comments on commit ff5266a

Please sign in to comment.