-
Notifications
You must be signed in to change notification settings - Fork 83
101 lines (89 loc) · 4.01 KB
/
release.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
93
94
95
96
97
98
99
100
101
name: Release
env:
SUBWASM_VERSION: 0.20.0
on:
push:
tags:
- 'bifrost-*'
workflow_dispatch:
jobs:
srtool:
uses: ./.github/workflows/srtool.yml
release:
name: Create Release
needs: srtool
runs-on: ubuntu-latest
steps:
- name: Check to latest commit
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-11-15
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Download kusama strool result
uses: actions/download-artifact@v3
with:
name: bifrost-kusama-runtime
path: ${{ github.workspace }}/artifacts
- name: Download polkadot strool result
uses: actions/download-artifact@v3
with:
name: bifrost-polkadot-runtime
path: ${{ github.workspace }}/artifacts
- name: Build bifrost
working-directory: ${{ github.workspace }}
run: |
sudo apt-get install -y protobuf-compiler
make production-release
mkdir -p ${{ github.workspace }}/artifacts
mv ${{ github.workspace }}/target/production/bifrost ${{ github.workspace }}/artifacts/
mv ${{ github.workspace }}/artifacts/runtime/bifrost-kusama/target/srtool/release/wbuild/bifrost-kusama-runtime/bifrost_kusama_runtime.compact.compressed.wasm ${{ github.workspace }}/artifacts/
mv ${{ github.workspace }}/artifacts/runtime/bifrost-polkadot/target/srtool/release/wbuild/bifrost-polkadot-runtime/bifrost_polkadot_runtime.compact.compressed.wasm ${{ github.workspace }}/artifacts/
pushd ${{ github.workspace }}/artifacts
sha256sum bifrost | tee bifrost.sha256
shasum -c bifrost.sha256
popd
# We now get extra information thanks to subwasm,
- name: Install subwasm ${{ env.SUBWASM_VERSION }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Subwasm info
run: |
echo "# Upgrade Priority
Low: This is a low priority release and you may upgrade at your convenience." >> ${{ github.workspace }}-CHANGELOG.txt
echo "## Bifrost Kusama Runtime" >> ${{ github.workspace }}-CHANGELOG.txt
echo '```' >> ${{ github.workspace }}-CHANGELOG.txt
subwasm info ${{ github.workspace }}/artifacts/bifrost_kusama_runtime.compact.compressed.wasm >> ${{ github.workspace }}-CHANGELOG.txt
echo '```' >> ${{ github.workspace }}-CHANGELOG.txt
echo ' ' >> ${{ github.workspace }}-CHANGELOG.txt
echo "## Bifrost Polkadot Runtime" >> ${{ github.workspace }}-CHANGELOG.txt
echo '```' >> ${{ github.workspace }}-CHANGELOG.txt
subwasm info ${{ github.workspace }}/artifacts/bifrost_polkadot_runtime.compact.compressed.wasm >> ${{ github.workspace }}-CHANGELOG.txt
echo '```' >> ${{ github.workspace }}-CHANGELOG.txt
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
body_path: ${{ github.workspace }}-CHANGELOG.txt
append_body: true
prerelease: true
files: |
${{ github.workspace }}/artifacts/bifrost
${{ github.workspace }}/artifacts/bifrost.sha256
${{ github.workspace }}/artifacts/bifrost_kusama_runtime.compact.compressed.wasm
${{ github.workspace }}/artifacts/bifrost_polkadot_runtime.compact.compressed.wasm
- uses: 8398a7/action-slack@v3
if: always()
with:
status: ${{ job.status }}
fields: repo,author,eventName,workflow,ref,commit
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}