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

chore: publish metadata as gitlab artifact #459

Merged
merged 11 commits into from
May 2, 2023
18 changes: 18 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
stages:
- test
- build
- upload

clippy:
# Corresponds to paritytech/ci-linux:production at the time of this PR
Expand Down Expand Up @@ -80,6 +81,7 @@ build-wasm-peregrine:
- export RUNTIME_DIR=runtimes/peregrine
- cp -r * /build
- /srtool/build build
- subwasm --json meta /out/peregrine_runtime.compact.wasm > /out/peregrine-metadata.json
- mkdir ./out
- mv /out/* ./out/
artifacts:
Expand All @@ -101,9 +103,25 @@ build-wasm-spiritnet:
- export RUNTIME_DIR=runtimes/spiritnet
- cp -r * /build
- /srtool/build build
- subwasm --json meta /out/spiritnet_runtime.wasm > /out/spiritnet-metadata.json
- mkdir ./out
- mv /out/* ./out/
artifacts:
paths:
- out/*.wasm
expire_in: 12 week

upload:
stage: upload
dependencies:
- build-wasm-spiritnet
- build-wasm-peregrine
image: amazon/aws-cli:2.9.18
script:
- aws configure set region $AWS_DEFAULT_REGION
- aws s3 cp /out/peregrine-metadata.json s3://$S3_BUCKET/peregrine/${CI_COMMIT_TAG}/
Copy link
Member

Choose a reason for hiding this comment

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

@ggera as far as I know, CI_COMMIT_TAG could be empty if the job was simply triggered by a commit push. Would it make sense to have the same logic we have for Docker image tagging? Or maybe push something like <branch-commit> if a regular push and <tag> if a tag.

- aws s3 cp /out/spiritnet-metadata.json s3://$S3_BUCKET/spiritnet/${CI_COMMIT_TAG}/
only:
- master
- develop