-
Notifications
You must be signed in to change notification settings - Fork 25
123 lines (110 loc) · 4.78 KB
/
build-release.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: Create Runtimes releases
on:
workflow_dispatch:
inputs:
tag_version:
description: 'Tag version for the release'
required: true
type: string
jobs:
generate-chain-specs:
uses: ./.github/workflows/generate-chain-specs.yaml
permissions:
contents: write
packages: write
with:
tag_version: ${{ github.event.inputs.tag_version }}
create-tag:
needs: generate-chain-specs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Setup Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.PASEO_RUNTIME_CI_PAT }}
- name: Create and push tag
run: |
git checkout ${{ github.ref }}
git tag ${{ github.event.inputs.tag_version }}
git push origin ${{ github.event.inputs.tag_version }}
srtool:
needs: create-tag
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
runtime:
- name: "paseo"
path: "relay/paseo"
- name: "asset-hub-paseo"
path: "system-parachains/asset-hub-paseo"
- name: "bridge-hub-paseo"
path: "system-parachains/bridge-hub-paseo"
- name: "people-paseo"
path: "system-parachains/people-paseo"
- name: "coretime-paseo"
path: "system-parachains/coretime-paseo"
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_version }}
- name: Cache runtime target dir
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/runtime/${{ matrix.runtime.name }}/target"
key: srtool-target-${{ matrix.runtime.name }}-${{ github.sha }}
restore-keys: |
srtool-target-${{ matrix.runtime.name }}-
srtool-target-
- name: Build ${{ matrix.runtime.name }} runtime
id: srtool_build
uses: chevdor/[email protected]
env:
BUILD_OPTS: "--features on-chain-release-build"
with:
chain: ${{ matrix.runtime.name }}
package: "${{ matrix.runtime.name }}-runtime"
runtime_dir: ${{ matrix.runtime.path }}
profile: "production"
- name: Store srtool digest to disk
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.runtime.name }}-srtool-digest.json
# Copy artifacts
- name: Copy artifacts
run: cp `dirname ${{ steps.srtool_build.outputs.wasm }}`/*.wasm ./
- name: Archive Runtime
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runtime.name }}-runtime-${{ github.event.inputs.tag_version }}
path: |
${{ matrix.runtime.name }}*.wasm
${{ matrix.runtime.name }}-srtool-digest.json
# Release published: add artifacts to release
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.PASEO_RUNTIME_CI_PAT }}
run: |
gh release create ${{ github.event.inputs.tag_version }} \
--title "Release ${{ github.event.inputs.tag_version }}" \
--generate-notes \
--notes "## Runtime: \`${{ matrix.runtime.name }}\`
\`\`\`
🏋️ Runtime Size: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.size }} bytes
🔥 Core Version: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.core_version.specName }}-${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.core_version.specVersion }}
🎁 Metadata version: V${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.metadata_version }}
🗳️ system.setCode hash: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.proposal_hash }}
🗳️ authorizeUpgrade hash: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }}
🗳️ Blake2-256 hash: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.blake2_256 }}
📦 IPFS: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.ipfs_hash }}
\`\`\`" \
${{ steps.srtool_build.outputs.wasm_compressed }} \
${{ matrix.runtime.name }}-srtool-digest.json