Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[CI] Expose WASM binaries on publish #1093

Merged
merged 13 commits into from
May 15, 2020
38 changes: 17 additions & 21 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# pipelines can be triggered manually in the web
# setting DEPLOY_TAG will only deploy the tagged image


stages:
- test
- build
Expand All @@ -23,7 +22,6 @@ variables:
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"


.collect-artifacts: &collect-artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
Expand Down Expand Up @@ -56,8 +54,6 @@ variables:
- cargo --version
- sccache -s



.build-refs: &build-refs
only:
- master
Expand Down Expand Up @@ -100,7 +96,6 @@ check-runtime:
interruptible: true
allow_failure: true


check-line-width:
stage: test
image: parity/tools:latest
Expand Down Expand Up @@ -138,7 +133,6 @@ test-linux-stable: &test
- time cargo test --all --release --verbose --locked --features runtime-benchmarks
- sccache -s


check-web-wasm: &test
stage: test
<<: *test-refs
Expand Down Expand Up @@ -167,6 +161,22 @@ check-runtime-benchmarks: &test
- time cargo check --features runtime-benchmarks
- sccache -s

build-wasm-release:
stage: build
<<: *collect-artifacts
<<: *docker-env
<<: *compiler_info
# Note: We likely only want to do this for tagged releases, hence the 'only:'
only:
# FIXME remove when ready to merge
- /^[0-9]+$/
# - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
- time wasm-pack build --target web --out-dir wasm --release cli -- --no-default-features --features browser
- mkdir -p ./artifacts/wasm
- cd ./cli/wasm/
- for f in polkadot_cli*; do sha256sum "${f}" > "${f}.sha256"; done
- mv ./polkadot_cli* ../../artifacts/wasm/.

build-linux-release: &build
stage: build
Expand All @@ -193,13 +203,11 @@ build-linux-release: &build
- cp -r scripts/docker/* ./artifacts
- sccache -s




.publish-build: &publish-build
stage: publish
dependencies:
- build-linux-release
- build-wasm-release
Copy link
Contributor

Choose a reason for hiding this comment

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

can artifacts be fetched that way from two different jobs which ran in parallel before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, wasn't sure about this myself so I made a test job to verify it: https://gitlab.parity.io/parity/polkadot/-/jobs/507196

Copy link
Contributor

Choose a reason for hiding this comment

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

nice job!

cache: {}
<<: *build-refs
<<: *kubernetes-env
Expand All @@ -210,9 +218,6 @@ build-linux-release: &build
- EXTRATAG="$(cat ./artifacts/EXTRATAG)"
- echo "Polkadot version = ${VERSION} (EXTRATAG ${EXTRATAG})"




publish-docker-release:
<<: *publish-build
image: docker:stable
Expand Down Expand Up @@ -243,9 +248,6 @@ publish-docker-release:
# only VERSION information is needed for the deployment
- find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete




publish-s3-release:
<<: *publish-build
image: parity/awscli:latest
Expand Down Expand Up @@ -276,12 +278,6 @@ publish-s3-release:
- aws s3 ls s3://${BUCKET}/${PREFIX}/${EXTRATAG}/
--recursive --human-readable --summarize







deploy-polkasync-kusama:
stage: deploy
<<: *build-refs
Expand Down