-
Notifications
You must be signed in to change notification settings - Fork 115
110 lines (89 loc) · 3.58 KB
/
create-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
102
103
104
105
106
107
108
109
110
name: Create release with node binaries
on:
workflow_dispatch:
inputs:
name:
description: 'Release name (v9.3.0 - Antioch)'
required: true
tag:
description: 'Tag (v9.3.0)'
required: true
env:
REPOSITORY: joystream/node
jobs:
build-mac-binary:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- id: compute_shasum
name: Compute runtime code shasum
run: |
export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
- name: Run Setup
run: |
./setup.sh
- name: Build binaries
run: |
yarn cargo-build
- name: Tar the binary
run: |
tar czvf joystream-node-macos.tar.gz -C ./target/release joystream-node
- name: Temporarily save node binary
uses: actions/upload-artifact@v3
with:
name: joystream-node-macos-${{ steps.compute_shasum.outputs.shasum }}
path: joystream-node-macos.tar.gz
retention-days: 1
create-release:
runs-on: ubuntu-latest
needs: build-mac-binary
steps:
- name: Checkout
uses: actions/checkout@v3
- id: compute_shasum
name: Compute runtime code shasum
run: |
export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
- id: extract_binaries
name: Copy binaries & wasm file from docker images
run: |
IMAGE=${{ env.REPOSITORY }}:${{ steps.compute_shasum.outputs.shasum }}
docker run -d --entrypoint tail --name temp-container-joystream-node $IMAGE-amd64 -f /dev/null
RESULT=`docker exec temp-container-joystream-node b2sum -l 256 runtime.compact.compressed.wasm | awk '{print $1}'`
VERSION_AND_COMMIT=`docker exec temp-container-joystream-node /joystream/node --version | awk '{print $2}' | cut -d- -f -2`
echo "::set-output name=blob_hash::${RESULT}"
echo "::set-output name=version_and_commit::${VERSION_AND_COMMIT}"
docker cp temp-container-joystream-node:/joystream/runtime.compact.compressed.wasm ./joystream_runtime_${{ github.event.inputs.tag }}.wasm
docker cp temp-container-joystream-node:/joystream/node ./joystream-node
tar -czvf joystream-node-$VERSION_AND_COMMIT-x86_64-linux-gnu.tar.gz joystream-node
docker rm --force temp-container-joystream-node
docker cp `docker create --rm $IMAGE-arm64`:/joystream/node ./joystream-node
tar -czvf joystream-node-$VERSION_AND_COMMIT-arm64-linux-gnu.tar.gz joystream-node
- name: Retrieve saved MacOS binary
uses: actions/download-artifact@v3
with:
name: joystream-node-macos-${{ steps.compute_shasum.outputs.shasum }}
- name: Rename MacOS binary and tar
run: |
mv joystream-node-macos.tar.gz joystream-node-${{ steps.extract_binaries.outputs.version_and_commit }}-x86_64-macos.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
*.tar.gz
*.wasm
tag_name: ${{ github.event.inputs.tag }}
name: ${{ github.event.inputs.name }}
draft: true
body: 'Verify wasm hash:
```
$ b2sum -l 256 joystream_runtime_${{ github.event.inputs.tag }}.wasm
```
This should be the output
```
${{ steps.extract_binaries.outputs.blob_hash }}
```
'