-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (49 loc) · 1.42 KB
/
build-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
name: Build-Release
on:
workflow_call:
inputs:
release:
description: 'release'
type: boolean
required: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
id: cache-toolchaine
with:
path: |
~/.rustup
~/.cargo
key: ${{ runner.os }}-rust-1.71-opt
- name: Rust Toolchain Setup
if: steps.cache-toolchaine.outputs.cache-hit != 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
cargo install wasm-snip
- name: Compile
run: |
# respect target from rust-toolchain and .cargo/config
cargo build --release
- name: Optimize
run: |
TARGET=target/wasm32-wasip1/release/zellij-datetime.wasm
wasm-snip ${TARGET} -o ${TARGET}.snip.wasm
rm ${TARGET}
mv ${TARGET}.snip.wasm ${TARGET}
- name: Check
run: |
TARGET=target/wasm32-wasip1/release/zellij-datetime.wasm
ls -laF ${TARGET}
file ${TARGET} | grep WebAssembly | grep 'version 0x1'
md5sum ${TARGET}
- uses: ncipollo/release-action@v1
if: ${{ inputs.release }}
with:
artifacts: "target/wasm32-wasip1/release/zellij-datetime.wasm"
token: ${{ secrets.GITHUB_TOKEN }}