Merge remote-tracking branch 'origin/master' #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- 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: './web' | |
wranglerVersion: 3 |