cql2 0.5.5

Parse, validate, and convert Common Query Language (CQL2) text and JSON
Documentation
name: npm

on:
  push:
    tags:
      - "cql2-v*"
  workflow_dispatch:

jobs:
  build:
    name: Build WASM package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
      - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
      - name: Install wasm-pack
        run: cargo install wasm-pack
      - name: Build WASM for npm
        run: wasm-pack build --target web --out-dir pkg wasm
      - name: Upload package
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
        with:
          name: npm-package
          path: wasm/pkg

  publish:
    name: Publish to npm
    runs-on: ubuntu-latest
    needs: build
    permissions:
      id-token: write
      contents: read
      attestations: write
    environment:
      name: npm
      url: https://www.npmjs.com/package/cql2-wasm
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
        with:
          name: npm-package
          path: package
      - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
        with:
          node-version: "20"
          registry-url: "https://registry.npmjs.org"
      - name: Upgrade npm version
        run: npm install -g npm@latest
      - name: Generate artifact attestation
        uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4
        with:
          subject-path: "package/*"
      - name: Publish to npm
        working-directory: package
        run: npm publish --provenance --access public