-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.7 KB
/
deploy.yml
File metadata and controls
65 lines (54 loc) · 1.7 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
name: Build and Update
on:
push:
tags:
- v**
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set Tag Variable
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Checkout Compiler
uses: actions/checkout@v4
with:
repository: librasn/compiler
path: $HOME/compiler
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Checkout Pages Src
uses: actions/checkout@v4
with:
ref: main
path: $HOME/web
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: $HOME/web/package-lock.json
- name: Build for WASM
working-directory: $HOME/compiler
run: |
cargo build -p rasn-compiler --target wasm32-unknown-unknown --release
cargo install -f wasm-bindgen-cli --version 0.2.92
wasm-bindgen --out-dir $HOME/web/src/lib/compiler --target web ./target/wasm32-unknown-unknown/release/librasn_compiler.wasm
- name: Install Page Dependencies
working-directory: $HOME/web
run: npm install
- name: Build Page
working-directory: $HOME/web
run: npm run build
- name: Push WASM Updates
working-directory: $HOME/web
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "chore: release $RELEASE_VERSION"
git push