Skip to content

Build and Publish Node Image #7

Build and Publish Node Image

Build and Publish Node Image #7

name: Build and Publish Node Image
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "/build-wasm.sh"
- "/src/**"
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compile WebAssembly
run: ./build-wasm.sh
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install dependencies
run: pnpm install
working-directory: src
- name: Pack package
run: pnpm pack
working-directory: src
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: libqalculate-wasm
path: src/libqalculate-wasm-*.tgz
publish:
# if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: libqalculate-wasm
- name: Check
run: tree
- name: Publish package
run: npm publish
working-directory: package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}