Skip to content

Build, Release, Deploy #45

Build, Release, Deploy

Build, Release, Deploy #45

name: Build, Release, Deploy
on:
workflow_dispatch:
release:
types: [created] # Trigger when a new release is created
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build_release:
name: Build release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install Binstall
uses: cargo-bins/cargo-binstall@main
- name: Set up Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-unknown-unknown, wasm32-wasi
toolchain: nightly-x86_64-unknown-linux-gnu
components: rust-src, rustfmt
- name: Install cargo component v0.13.2
run: echo yes | cargo binstall [email protected]
- name: Run binstall just, wasm-tools
run: |
cargo binstall just --no-confirm
cargo binstall wasm-tools --no-confirm
- name: Build and Compose Wasm
run: |
just build-submodules
just compose
- name: Archive build
uses: actions/upload-artifact@v4
with:
name: wasm-artifact
path: dist/peerpiper_wallet_aggregate.wasm
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: dist/peerpiper_wallet_aggregate.wasm
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set VITE_BASE
run: |
echo "VITE_BASE=https://${GITHUB_REPOSITORY_OWNER,,}.github.io/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Set BASE_PATH
run: |
echo "BASE_PATH=/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: npm
cache-dependency-path: "./packages/integrity-wallet/package-lock.json"
- name: Install dependencies
run: |
cd packages/integrity-wallet
npm install
cd inner-app
npm install
- name: build
env:
BASE_PATH: ${{ env.BASE_PATH }}
VITE_BASE: ${{ env.VITE_BASE }}
run: |
cd packages/integrity-wallet/inner-app
npm run build
cd ..
npm run build
# touch docs/.nojekyll
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v1
with:
# this should match the `pages` option in your adapter-static options
path: "packages/integrity-wallet/docs/"
deploy:
needs: build_release
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v3
- name: Deploy
id: deployment
uses: actions/deploy-pages@v2