-
Notifications
You must be signed in to change notification settings - Fork 10
188 lines (159 loc) · 4.73 KB
/
release.yml
File metadata and controls
188 lines (159 loc) · 4.73 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Release
on:
release:
types: [published]
pull_request:
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
jobs:
build-bin:
name: Build bin tool
runs-on: ${{matrix.os}}
strategy:
max-parallel: 2
matrix:
include:
- build: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
cross: false
bin_suffix: x86_64-linux
- build: arm-v7
os: ubuntu-latest
rust: stable
target: armv7-unknown-linux-gnueabihf
linker: gcc-arm-linux-gnueabihf
cross: true
bin_suffix: arm-v7-linux
- build: aarch64
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
linker: gcc-aarch64-linux-gnu
cross: true
bin_suffix: aarch64-linux
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
cross: false
bin_suffix: macos
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: Cache
uses: actions/cache@v4.2.3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-${{ matrix.rust }}
- name: Install Linker
if: matrix.cross
run: |
sudo apt update
sudo apt install ${{ matrix.linker }}
cat .cargo/config.github >> .cargo/config
- name: Install Rust
run: |
rustup install ${{ matrix.rust }}
rustup target add ${{ matrix.target }}
rustup show
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Copy and rename binary
if: github.event_name == 'release'
run: cp target/${{ matrix.target }}/release/esp_stacktrace_decoder esp_stacktrace_decoder_${{ matrix.bin_suffix }}
- name: Upload to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2.3.2
with:
files: esp_stacktrace_decoder_${{ matrix.bin_suffix }}
build-exe:
name: Build exe tool
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: Cache
uses: actions/cache@v4.2.3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-stable
- name: Install Linker
run: |
sudo apt update
sudo apt install mingw-w64
- name: Install Rust
run: |
rustup install stable
rustup target add x86_64-pc-windows-gnu
rustup show
- name: Build
run: cargo build --release --target x86_64-pc-windows-gnu
- name: Upload to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2.3.2
with:
files: target/x86_64-pc-windows-gnu/release/esp_stacktrace_decoder.exe
build-web:
name: Build web tool
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: jetli/wasm-pack-action@v0.4.0
- name: Run wasm-pack
run: wasm-pack build --target web --out-dir web/
- name: Make an archive for web deployment
if: github.event_name == 'release'
run: tar czf esp_stacktrace_decoder_wasm.tar.gz -C web index.html esp_stacktrace_decoder_rs.js esp_stacktrace_decoder_rs_bg.wasm
- name: Upload to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2.3.2
with:
files: esp_stacktrace_decoder_wasm.tar.gz
- name: Copy files for GitHub Pages deployment
if: github.event_name == 'release'
run: mkdir -p public; cp web/index.html web/esp_stacktrace_decoder_rs.js web/esp_stacktrace_decoder_rs_bg.wasm public/
- uses: actions/upload-pages-artifact@v3.0.1
if: github.event_name == 'release'
with:
path: public
retention-days: 1
deploy-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
contents: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.event_name == 'release'
needs:
- build-web
steps:
- name: Setup Pages
uses: actions/configure-pages@v5.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5