forked from everx-labs/ever-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (91 loc) · 2.74 KB
/
prerelease_wasm.yaml
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
name: Prerelease WASM
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
env:
release: ${{ startsWith(github.ref, 'refs/tags/') && github.repository == 'gosh-sh/ever-sdk-js' }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Build
env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_VERSION: ${{ vars.SCCACHE_GHA_VERSION || 1 }} # Setting this env var enables the caching
RUSTC_WRAPPER: sccache
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set VERSION
id: version
run: |
echo "VERSION=$(cat version.json | jq -r .version)" >> "$GITHUB_OUTPUT"
- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Setup cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: builder-${{ runner.os }}-cargo
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install Linux tools
env:
packages: >-
build-essential
cmake
curl
clang
run: |
sudo apt update -yq
sudo apt install -yq $packages
- name: Build
working-directory: packages/lib-web/build
env:
CARGO_INCREMENTAL: 0 # important for cache size too
CARGO_NET_RETRY: 10
RUST_BACKTRACE: full
RUSTUP_MAX_RETRIES: 10
run: |
cargo update
cargo run -r
- name: Fix names
working-directory: packages/lib-web/publish
run: |
mv eversdk_*_wasm.gz eversdk.wasm.gz
mv eversdk_*_wasm_js.gz eversdk.wasm.js.gz
- name: Upload Draft
uses: softprops/action-gh-release@v1
if: env.release != 'true'
with:
draft: true
tag_name: ${{ github.ref_name }}-${{ github.run_number }}
files: |
packages/lib-web/publish/eversdk.wasm.gz
packages/lib-web/publish/eversdk.wasm.js.gz
body: ""
- name: Upload Prerelease
uses: softprops/action-gh-release@v1
if: env.release == 'true'
with:
prerelease: true
tag_name: ${{ github.ref_name }}
files: |
packages/lib-web/publish/eversdk.wasm.gz
packages/lib-web/publish/eversdk.wasm.js.gz
name: "Version: ${{ github.ref_name }}"
body: ""