-
Notifications
You must be signed in to change notification settings - Fork 71
173 lines (167 loc) · 5.63 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: Tag for release
required: true
jobs:
build-binary:
name: Build Binary
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}
- name: Setup Rust
run: rustup show
- name: Inspect node runner env
run: |
# Output our glibc version of the github runner
ldd --version
- name: Build
run: |
cargo build --locked --release --features turing-node,oak-node
mkdir -p artifacts/
cp target/release/oak-collator artifacts/
- name: Inspect glibc
run: |
# We current support glibc <= 2.31(Ubuntu 20 LTS). Expect all output of a smaller or equal glibc version.
objdump -T target/release/oak-collator | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
- name: Build debian
run: |
cargo install cargo-deb
cargo deb -p oak-node -- --release --features turing-node,oak-node
cp target/debian/*.deb artifacts/
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: oak-collator
path: artifacts/
build-runtime:
name: Build Runtime
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["turing", "oak"]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}
- name: Build
id: srtool_build
uses: chevdor/srtool-actions@v0.5.0
with:
chain: ${{ matrix.chain }}
tag: 1.70.0
- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.chain }}-srtool-digest.json
cat ${{ matrix.chain }}-srtool-digest.json
cp ${{ steps.srtool_build.outputs.wasm_compressed }} ${{ matrix.chain }}-runtime.wasm
- name: Upload runtime
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime
path: |
${{ matrix.chain }}-runtime.wasm
${{ matrix.chain }}-srtool-digest.json
release:
name: Release
runs-on: ubuntu-latest
needs:
- build-binary
- build-runtime
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}
fetch-depth: 0
- name: Download binary
uses: actions/download-artifact@v2
with:
name: oak-collator
- name: Get debian package name
id: package
run: |
echo ::set-output name=name::$(ls -a *.deb | head -n 1)
- name: Download Turing runtime
uses: actions/download-artifact@v2
with:
name: turing-runtime
- name: Download OAK runtime
uses: actions/download-artifact@v2
with:
name: oak-runtime
- name: Generate notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./.maintain/generate-release-notes ${{ github.event.inputs.tag }} > notes.md
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }}
body_path: notes.md
draft: true
- name: Upload binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: oak-collator
asset_name: oak-collator
asset_content_type: application/octet-stream
- name: Upload deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.package.outputs.name }}
asset_name: oak-collator.deb
asset_content_type: application/octet-stream
- name: Upload Turing runtime
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: turing-runtime.wasm
asset_name: turing-runtime.wasm
asset_content_type: application/octet-stream
- name: Upload Turing runtime digest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: turing-srtool-digest.json
asset_name: turing-srtool-digest.json
asset_content_type: application/octet-stream
- name: Upload OAK runtime
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: oak-runtime.wasm
asset_name: oak-runtime.wasm
asset_content_type: application/octet-stream
- name: Upload OAK runtime digest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: oak-srtool-digest.json
asset_name: oak-srtool-digest.json
asset_content_type: application/octet-stream