-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (49 loc) · 1.69 KB
/
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
name: Compile and Publish Web Assembly Edition
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
wasm:
runs-on: windows-latest
steps:
- name: disable git eol translation
run: git config --global core.autocrlf false
- name: checkout
uses: actions/checkout@v3
- name: Install Wrangler
run: |
node -v
npx --yes wrangler@3.28.2
- name: Install Rustup using win.rustup.rs
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=nightly
del rustup-init.exe
rustup target add x86_64-pc-windows-msvc --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
shell: powershell
- name: Add mingw64 to path for x86_64-msvc
shell: bash
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Add wasm-pack
shell: cmd
run: cargo install wasm-pack
- name: Build
shell: cmd
run: wasm-pack build --release --target web --out-dir nbtworkbench
- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: 'nbtworkbench'
directory: .
workingDirectory: './web'
wranglerVersion: 3.28.2