-
Notifications
You must be signed in to change notification settings - Fork 46
/
.gitlab-ci.yml
92 lines (87 loc) · 3.15 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
workflow:
name: GitLab build pipeline
rules:
- if: '$CI_PIPELINE_SOURCE == "trigger"'
stages:
- build
build-production-wasm:
image:
name: paritytech/srtool:1.75.0
entrypoint: [""]
stage: build
parallel:
matrix:
- RUNTIME: ["peregrine", "spiritnet"]
script:
- export PACKAGE=${RUNTIME}-runtime
- export RUNTIME_DIR=runtimes/${RUNTIME}
- export PARACHAIN_PALLET_ID=0x50
- export AUTHORIZE_UPGRADE_PREFIX=0x02
- export AUTHORIZE_UPGRADE_CHECK_VERSION=true
- export VERBOSE=true
- cp -r * /build
- /srtool/build build
- subwasm meta --format=json+scale /out/${RUNTIME}_runtime.compact.wasm > /out/${RUNTIME}-metadata.json
- subwasm get -o ${RUNTIME}-live.wasm wss://${RUNTIME}.kilt.io
- subwasm diff --no-color ${RUNTIME}-live.wasm /out/${RUNTIME}_runtime.compact.wasm | tee /out/${RUNTIME}-diff.txt
- mkdir -p ./out
- mv /out/* ./out/
artifacts:
paths:
- out/*.wasm
- out/*.json
- out/*.txt
expire_in: 12 week
build-try-state-wasm:
image:
name: paritytech/ci-unified:bullseye-1.74.0
stage: build
parallel:
matrix:
- RUNTIME: ["peregrine", "spiritnet"]
variables:
# Move cargo data INSIDE the project dir so it can be cached
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
cache:
when: always
key:
# E.g., `build-try-state-wasm-develop-peregrine` and `build-try-state-wasm-develop-spiritnet`
prefix: "$CI_JOB_NAME:$CI_COMMIT_REF_NAME:${RUNTIME}"
files:
- Cargo.lock
paths:
- $CARGO_HOME/bin/
- $CARGO_HOME/registry/index/
- $CARGO_HOME/registry/cache/
- $CARGO_HOME/git/db/
script:
- cargo build --release --locked -p ${RUNTIME}-runtime --features try-runtime
- mkdir -p out
- mv target/release/wbuild/${RUNTIME}-runtime/${RUNTIME}_runtime.compact.compressed.wasm out/**UNSAFE**${RUNTIME}_runtime_try_runtime.compact.compressed.wasm
artifacts:
paths:
- out
expire_in: 12 week
build-docker-images:
timeout: 2 hours
image:
name: kiltprotocol/kilt-ci:2.7.31
entrypoint: [""]
stage: build
variables:
DOCKER_HUB_PARACHAIN: "kiltprotocol/kilt-node"
DOCKER_HUB_STANDALONE: "kiltprotocol/standalone-node"
DOCKER_HUB_DIP_PROVIDER_TEMPLATE: "kiltprotocol/dip-provider-node-template"
DOCKER_HUB_DIP_CONSUMER_TEMPLATE: "kiltprotocol/dip-consumer-node-template"
before_script:
- aws --version
- docker --version
script:
- echo -n $CI_REGISTRY_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_REGISTRY
- ./.maintain/docker-auth-config.sh
- ./.maintain/build-image.sh build
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_SHORT_SHA}; fi"
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build latest-${CI_COMMIT_BRANCH}; fi"
- "if [[ ! -z ${CI_COMMIT_TAG} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_TAG}; fi"
- "if [[ ! -z ${CI_COMMIT_TAG} && ! -z ${CI_COMMIT_TAG##*-rc*} && ! -z ${CI_COMMIT_TAG##*dev-*} ]]; then ./.maintain/push-image.sh build latest; fi"