-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow to verify artifacts (#8056)
* 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
1 parent
b797f2e
commit ff5266a
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |