Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow to verify artifacts #8056

Merged
merged 9 commits into from
Jan 14, 2025
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 }}"
40 changes: 40 additions & 0 deletions .github/workflows/verify_artifacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import requests
import argparse


def create_artifact_paths(version):
artifacts = []
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
besu_paths = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macfarla add to this list here to keep it fresh and it'll check jar, pom and module for each item

f"evm/{version}/evm-{version}",
f"plugin-api/{version}/plugin-api-{version}",
f"internal/metrics-core/{version}/metrics-core-{version}",
f"internal/core/{version}/core-{version}",
f"internal/config/{version}/config-{version}"
]
for path in besu_paths:
artifacts.append(f"{artifacts_base_path}/{path}.module")
artifacts.append(f"{artifacts_base_path}/{path}.pom")
artifacts.append(f"{artifacts_base_path}/{path}.jar")
return artifacts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also verify bom is present

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Done @macfarla. This is now a plain list so easy to edit. Ready for review


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()
Loading