Skip to content

0.1.9

0.1.9 #21

Workflow file for this run

name: Publish
on:
push:
tags:
- "v*"
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: "always"
RUST_LOG: "off"
jobs:
wasm-build:
name: Wasm build
runs-on: ubuntu-latest
strategy:
matrix:
crate: ["biome_fmt", "web_fmt", "json_fmt"]
steps:
- uses: actions/checkout@v4
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build ${{matrix.crate}} wasm
run: |
./crates/${{ matrix.crate }}/scripts/build.sh
- name: Package ${{matrix.crate}}
working-directory: crates/${{matrix.crate}}/pkg
run: npm pack
- name: Upload ${{matrix.crate}}
uses: actions/upload-artifact@v4
with:
name: ${{matrix.crate}}
path: |
crates/${{matrix.crate}}/pkg
# To keep the pkg directory structure
crates/${{matrix.crate}}/README.md
publish-npm:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
id-token: write
strategy:
matrix:
crate: ["biome_fmt", "web_fmt", "json_fmt"]
needs: wasm-build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{matrix.crate}}
path: crates/${{matrix.crate}}
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: "https://registry.npmjs.org"
- name: Publish ${{matrix.crate}}
working-directory: crates/${{matrix.crate}}/pkg
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-jsr:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
crate: ["biome_fmt", "web_fmt", "json_fmt"]
needs: wasm-build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{matrix.crate}}
path: crates/${{matrix.crate}}
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: "https://registry.npmjs.org"
- name: Publish ${{matrix.crate}}
working-directory: crates/${{matrix.crate}}/pkg
run: npx jsr publish
publish-github:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
crate: ["biome_fmt", "web_fmt", "json_fmt"]
needs: wasm-build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{matrix.crate}}
path: crates/${{matrix.crate}}
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: "https://npm.pkg.github.com"
- name: Publish ${{matrix.crate}}
working-directory: crates/${{matrix.crate}}/pkg
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-github-release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
crate: ["biome_fmt", "web_fmt", "json_fmt"]
needs: wasm-build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{matrix.crate}}
path: crates/${{matrix.crate}}
- name: Package ${{matrix.crate}}
working-directory: crates/${{matrix.crate}}/pkg
run: npm pack
- name: Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
files: |
crates/*/pkg/*.tgz
crates/*/pkg/*.wasm