1- name : Build and Deploy
1+ name : Release
22
33on :
44 push :
55 tags :
6- - ' *'
6+ - v*
7+
8+ env :
9+ CARGO_TERM_COLOR : always
710
811jobs :
9- build-linux :
10- name : Build and deploy Linux binary
11- runs-on : ubuntu-latest
12+ publish-bin-to-github :
13+ name : Publish bin tool to Github
14+ runs-on : ${{matrix.os}}
15+ strategy :
16+ matrix :
17+ include :
18+ - build : linux
19+ os : ubuntu-latest
20+ rust : stable
21+ target : x86_64-unknown-linux-musl
22+ cross : false
23+ bin_suffix : x86_64-linux
24+ - build : arm-v7
25+ os : ubuntu-latest
26+ rust : stable
27+ target : armv7-unknown-linux-gnueabihf
28+ linker : gcc-arm-linux-gnueabihf
29+ cross : true
30+ bin_suffix : arm-v7-linux
31+ - build : aarch64
32+ os : ubuntu-latest
33+ rust : stable
34+ target : aarch64-unknown-linux-gnu
35+ linker : gcc-aarch64-linux-gnu
36+ cross : true
37+ bin_suffix : aarch64-linux
38+ - build : macos
39+ os : macos-latest
40+ rust : stable
41+ target : x86_64-apple-darwin
42+ cross : false
43+ bin_suffix : macos
44+ steps :
45+ - name : Checkout repository
46+ uses : actions/checkout@v2
47+ with :
48+ fetch-depth : 1
49+
50+ - name : Cache
51+ uses : actions/cache@v2
52+ with :
53+ path : |
54+ ~/.cargo/registry
55+ ~/.cargo/git
56+ ~/.rustup
57+ target
58+ key : ${{ runner.os }}-${{ matrix.rust }}
59+
60+ - name : Install Linker
61+ if : matrix.cross
62+ run : |
63+ sudo apt update
64+ sudo apt install ${{ matrix.linker }}
65+ cat .cargo/config.github >> .cargo/config
66+ - name : Install Rust
67+ run : |
68+ rustup install ${{ matrix.rust }}
69+ rustup target add ${{ matrix.target }}
70+ rustup show
71+ - name : Build
72+ run : cargo build --release --target ${{ matrix.target }}
73+ - name : Copy and rename binary
74+ run : cp target/${{ matrix.target }}/release/esp_exception_decoder esp_exception_decoder_${{ matrix.bin_suffix }}
1275
76+ - name : Release
77+ uses : softprops/action-gh-release@v1
78+ if : startsWith(github.ref, 'refs/tags/')
79+ with :
80+ files : esp_exception_decoder_${{ matrix.bin_suffix }}
81+ env :
82+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83+
84+ publish-exe-to-github :
85+ name : Publish exe tool to Github
86+ runs-on : ubuntu-latest
1387 steps :
14- - uses : actions/checkout@v2
15- - uses : actions-rs/toolchain@v1
16- with :
17- toolchain : stable
18- target : x86_64-unknown-linux-gnu
19- - uses : Swatinem/rust-cache@v1
20- - uses : actions-rs/cargo@v1
21- with :
22- command : build
23- args : --release --target x86_64-unknown-linux-gnu
24- - uses : svenstaro/upload-release-action@v2
25- with :
26- repo_token : ${{ secrets.GITHUB_TOKEN }}
27- file : target/x86_64-unknown-linux-gnu/release/esp_exception_decoder
28- asset_name : esp_exception_decoder
29- tag : ${{ github.ref }}
88+ - name : Checkout repository
89+ uses : actions/checkout@v2
90+ with :
91+ fetch-depth : 1
92+
93+ - name : Cache
94+ uses : actions/cache@v2
95+ with :
96+ path : |
97+ ~/.cargo/registry
98+ ~/.cargo/git
99+ ~/.rustup
100+ target
101+ key : ${{ runner.os }}-stable
30102
31- build-wasm :
32- name : Build and deploy WASM package
103+ - name : Install Linker
104+ run : |
105+ sudo apt update
106+ sudo apt install mingw-w64
107+ - name : Install Rust
108+ run : |
109+ rustup install stable
110+ rustup target add x86_64-pc-windows-gnu
111+ rustup show
112+ - name : Build
113+ run : cargo build --release --target x86_64-pc-windows-gnu
114+
115+ - name : Release
116+ uses : softprops/action-gh-release@v1
117+ if : startsWith(github.ref, 'refs/tags/')
118+ with :
119+ files : target/x86_64-pc-windows-gnu/release/esp_exception_decoder.exe
120+ env :
121+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122+
123+ publish-web-to-github :
124+ name : Publish web tool to GitHub
33125 runs-on : ubuntu-latest
34126
35127 steps :
@@ -45,14 +137,16 @@ jobs:
45137 run : wasm-pack build --target web --out-dir web/
46138 - name : Make an archive for web deployment
47139 run : tar czf esp_exception_decoder_wasm.tar.gz -C web index.html esp_exception_decoder_rs.js esp_exception_decoder_rs_bg.wasm
48- - uses : svenstaro/upload-release-action@v2
140+
141+ - name : Release
142+ uses : softprops/action-gh-release@v1
143+ if : startsWith(github.ref, 'refs/tags/')
49144 with :
50- repo_token : ${{ secrets.GITHUB_TOKEN }}
51- file : esp_exception_decoder_wasm.tar.gz
52- asset_name : esp_exception_decoder_wasm.tar.gz
53- tag : ${{ github.ref }}
54-
55- - name : Copy files for web deployment
145+ files : esp_exception_decoder_wasm.tar.gz
146+ env :
147+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
148+
149+ - name : Copy files for GitHub Pages deployment
56150 run : mkdir -p public; cp web/index.html web/esp_exception_decoder_rs.js web/esp_exception_decoder_rs_bg.wasm public/
57151 - uses : crazy-max/ghaction-github-pages@v2
58152 with :
0 commit comments