-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (118 loc) · 3.87 KB
/
build-runtime.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Compile runtimes
on:
pull_request:
paths-ignore:
- 'chronicle/**'
- 'contracts/**'
- 'docker/**'
- 'docs/**'
- 'infra/**'
- 'js/**'
- 'lib/**'
- 'scripts/**'
- 'tc-subxt/**'
- 'tester/**'
- 'tss/**'
- 'utils/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: [ self-hosted-timechain ]
steps:
- name: Install rust toolchain
run : rustup show
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: Cache cargo registry and index
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-cache-timechain-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-cache-timechain-
build-runtime:
runs-on: [ self-hosted-timechain ]
needs: [ setup ]
strategy:
fail-fast: false
matrix:
include:
- package: timechain-runtime
features: default
crate: timechain_runtime
- package: timechain-runtime
features: development
crate: timechain_runtime
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: Cache cargo build output
uses: actions/cache@v4
with:
path: target
key: cargo-build-${{ matrix.package }}-${{ matrix.features }}-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-build-${{ matrix.package }}-${{ matrix.features }}-
- name: Build timechain runtime
run: cargo build --package ${{ matrix.package }} --profile release --features ${{ matrix.features }}
- name: Upload timechain runtime
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.features }}.wasm
if-no-files-found: error
path: target/release/wbuild/${{ matrix.package }}/${{ matrix.crate }}.compact.compressed.wasm
- name: Upload timechain metadata
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.features }}.scale
if-no-files-found: error
path: target/release/wbuild/${{ matrix.package }}/${{ matrix.crate }}.metadata.scale
update-metadata:
runs-on: [ self-hosted-timechain ]
needs: [ build-runtime ]
if: ${{ always() }}
continue-on-error: true
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
submodules: recursive
- name: Download and update Testnet Metadata
id: download-testnet-default-metadata
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: timechain-runtime.default.scale
- name: Download and Testnet Metadata
if: steps.download-testnet-default-metadata.outcome == 'success'
run: mv timechain_runtime.metadata.scale config/subxt/testnet.default.scale
- name: Download Development Metadata
id: download-testnet-development-metadata
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: timechain-runtime.development.scale
- name: Update Development Metadata
if: steps.download-testnet-development-metadata.outcome == 'success'
run: mv timechain_runtime.metadata.scale config/subxt/testnet.development.scale
- name: Commit any changes to the metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! git diff --quiet; then
git config user.email "[email protected]"
git config user.name "Metadata Update Bot"
git commit -am "tc-subxt: Automated metadata update"
git push
fi