add zigbuild install #9
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: CI | |
on: | |
push: | |
branches: ['main'] | |
tags: | |
- "v*" | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to release (e.g., v1.2.3)' | |
required: false | |
default: '' | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- run: make install | |
- run: make test | |
release: | |
if: ${{ github.event.inputs.tag != '' || startsWith(github.ref, 'refs/tags/v') }} | |
runs-on: ubuntu-24.04 | |
needs: ['test'] | |
permissions: | |
contents: write | |
id-token: write # The OIDC ID token is used for authentication with JSR. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
# we'll need this for both 'zig build' and 'cargo zigbuild' | |
- uses: mlugg/setup-zig@v1 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- run: make install | |
- | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
# 'latest', 'nightly', or a semver | |
version: '~> v2' | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- working-directory: ./js | |
run: | | |
make build | |
npx jsr publish --allow-slow-types | |
npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |