-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (32 loc) · 1.13 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
# - uses: dfinity/setup-dfx@main
- name: Build canisters
run: |
rustup target add wasm32-unknown-unknown
cargo install ic-wasm
mkdir out
cargo build --target wasm32-unknown-unknown --release --locked -p idempotent-proxy-canister
CAN="idempotent_proxy_canister"
cp "target/wasm32-unknown-unknown/release/$CAN.wasm" out/
cp src/idempotent-proxy-canister/idempotent-proxy-canister.did "out/$CAN.did"
ic-wasm "out/$CAN.wasm" -o "out/$CAN.wasm" metadata candid:service -f "out/$CAN.did" -v public
ic-wasm "out/$CAN.wasm" -o "out/$CAN.wasm" shrink
ic-wasm "out/$CAN.wasm" -o "out/$CAN.wasm" optimize O3 --inline-functions-with-loops
gzip "out/$CAN.wasm"
SHA256="$(sha256sum < "out/$CAN.wasm.gz" | sed 's/ .*$//g')"
echo $SHA256 > "out/$CAN.wasm.gz.$SHA256.txt"
ls -lah out
- name: Release
uses: softprops/action-gh-release@v2
with:
files: out/*