Add webassembly package to the release zip #16
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
# This file is autogenerated by maturin v1.3.1 | |
# To update, run | |
# | |
# maturin generate-ci github | |
# | |
name: Web | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- github-action | |
tags: | |
- '*' | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Dependencies | |
run: | | |
apt update -y && apt-get install clang -y | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --profile=minimal --target=wasm32-unknown-unknown | |
npm install -g wasm-pack | |
- name: Build | |
run: | | |
cd ./web_assembly | |
wasm-pack build --target=web --release --out-dir=../map/pkg | |
- name: Deploy | |
run: | | |
npm install | |
mkdir aisdb_web | |
cd map | |
export VITE_DISABLE_SSL_DB=1 | |
export VITE_DISABLE_STREAM=1 | |
export VITE_AISDBHOST=localhost | |
export VITE_AISDBPORT=9924 | |
npx vite build --outDir=../aisdb_web/dist_map | |
export VITE_BINGMAPTILES=1 | |
export VITE_TILESERVER=aisdb.meridian.cs.dal.ca | |
npx vite build --outDir=../aisdb_web/dist_map_bingmaps | |
cd .. | |
mv ./map/pkg/ ./aisdb_web/map/pkg/ | |
- name: zip dist | |
run: | | |
zip -r aisdb_web.zip aisdb_web | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: true | |
- name: Upload Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./aisdb_web.zip | |
asset_name: aisdb_web.zip | |
asset_content_type: application/zip | |
# - name: Update Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: aisdb_web | |
# path: | | |
# aisdb_web/map/pkg | |
# aisdb_web/dist_map | |
# aisdb_web/dist_map_bingmaps | |