@@ -3,6 +3,7 @@ name: Release
3
3
on :
4
4
release :
5
5
types : [published]
6
+ pull_request :
6
7
7
8
env :
8
9
CARGO_TERM_COLOR : always
@@ -12,10 +13,11 @@ permissions:
12
13
contents : write
13
14
14
15
jobs :
15
- publish -bin-to-github :
16
- name : Publish bin tool to Github
16
+ build -bin :
17
+ name : Build bin tool
17
18
runs-on : ${{matrix.os}}
18
19
strategy :
20
+ max-parallel : 2
19
21
matrix :
20
22
include :
21
23
- build : linux
@@ -66,23 +68,28 @@ jobs:
66
68
sudo apt update
67
69
sudo apt install ${{ matrix.linker }}
68
70
cat .cargo/config.github >> .cargo/config
71
+
69
72
- name : Install Rust
70
73
run : |
71
74
rustup install ${{ matrix.rust }}
72
75
rustup target add ${{ matrix.target }}
73
76
rustup show
77
+
74
78
- name : Build
75
79
run : cargo build --release --target ${{ matrix.target }}
80
+
76
81
- name : Copy and rename binary
82
+ if : github.event_name == 'release'
77
83
run : cp target/${{ matrix.target }}/release/esp_stacktrace_decoder esp_stacktrace_decoder_${{ matrix.bin_suffix }}
78
84
79
- - name : Release
85
+ - name : Upload to GitHub Release
86
+ if : github.event_name == 'release'
80
87
81
88
with :
82
89
files : esp_stacktrace_decoder_${{ matrix.bin_suffix }}
83
90
84
- publish -exe-to-github :
85
- name : Publish exe tool to Github
91
+ build -exe :
92
+ name : Build exe tool
86
93
runs-on : ubuntu-latest
87
94
steps :
88
95
- name : Checkout repository
@@ -104,55 +111,77 @@ jobs:
104
111
run : |
105
112
sudo apt update
106
113
sudo apt install mingw-w64
114
+
107
115
- name : Install Rust
108
116
run : |
109
117
rustup install stable
110
118
rustup target add x86_64-pc-windows-gnu
111
119
rustup show
120
+
112
121
- name : Build
113
122
run : cargo build --release --target x86_64-pc-windows-gnu
114
123
115
- - name : Release
124
+ - name : Upload to GitHub Release
125
+ if : github.event_name == 'release'
116
126
117
127
with :
118
128
files : target/x86_64-pc-windows-gnu/release/esp_stacktrace_decoder.exe
119
129
120
- publish -web-to-github :
121
- name : Publish web tool to GitHub
130
+ build -web :
131
+ name : Build web tool
122
132
runs-on : ubuntu-latest
123
- permissions :
124
- pages : write
125
- id-token : write
126
- contents : write
127
133
128
134
steps :
129
135
136
+
130
137
- uses : actions-rs/toolchain@v1
131
138
with :
132
139
toolchain : stable
133
140
target : wasm32-unknown-unknown
141
+
134
142
- uses : Swatinem/rust-cache@v2
135
143
136
144
145
+
137
146
- name : Run wasm-pack
138
147
run : wasm-pack build --target web --out-dir web/
148
+
139
149
- name : Make an archive for web deployment
150
+ if : github.event_name == 'release'
140
151
run : tar czf esp_stacktrace_decoder_wasm.tar.gz -C web index.html esp_stacktrace_decoder_rs.js esp_stacktrace_decoder_rs_bg.wasm
141
152
142
- - name : Release
153
+ - name : Upload to GitHub Release
154
+ if : github.event_name == 'release'
143
155
144
156
with :
145
157
files : esp_stacktrace_decoder_wasm.tar.gz
146
158
147
159
- name : Copy files for GitHub Pages deployment
160
+ if : github.event_name == 'release'
148
161
run : mkdir -p public; cp web/index.html web/esp_stacktrace_decoder_rs.js web/esp_stacktrace_decoder_rs_bg.wasm public/
149
162
150
163
164
+ if : github.event_name == 'release'
151
165
with :
152
166
path : public
153
167
retention-days : 1
168
+
169
+ deploy-pages :
170
+ name : Deploy to GitHub Pages
171
+ runs-on : ubuntu-latest
172
+ permissions :
173
+ pages : write
174
+ id-token : write
175
+ contents : write
176
+ if : github.event_name == 'release'
177
+ needs :
178
+ - build-web
179
+ steps :
154
180
- name : Setup Pages
181
+ if : github.event_name == 'release'
155
182
183
+
156
184
- name : Deploy to GitHub Pages
185
+ if : github.event_name == 'release'
157
186
id : deployment
158
187
0 commit comments