Skip to content

chore: release 0.11.2 (#26) #32

chore: release 0.11.2 (#26)

chore: release 0.11.2 (#26) #32

Workflow file for this run

name: Publish
on:
push:
tags:
- "v*"
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
jobs:
preflight:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.0
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
with:
deno-version: v2.x
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 26
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Verify tag matches deno.json version
shell: bash
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag '${tag}' is not a stable semantic version."
exit 1
fi
package_version="$(bun -e 'console.log(require("./package.json").version)')"
deno_version="$(bun -e 'console.log(require("./deno.json").version)')"
if [[ "${package_version}" != "${deno_version}" ]]; then
echo "package.json version '${package_version}' does not match deno.json version '${deno_version}'."
exit 1
fi
if [[ "${tag}" != "v${package_version}" ]]; then
echo "Tag '${tag}' does not match package version '${package_version}'."
exit 1
fi
- name: Run checks
run: bun run check
- name: Check and test with Deno
run: deno task check
- name: Verify JSR package
run: deno publish --dry-run
- name: Verify npm package
run: bun run package:check
- name: Verify Node package runtime
run: |
node --input-type=module <<'JS'
import { parseAll, str } from "@claudiu-ceia/combine";
import { recognizeAt } from "@claudiu-ceia/combine/nondeterministic";
import { createTracer } from "@claudiu-ceia/combine/perf";
import { createStreamingParser } from "@claudiu-ceia/combine/streaming";
const result = parseAll(str("value"), "value");
if (!result.success || result.value !== "value") process.exit(1);
recognizeAt(str("value"));
createTracer();
createStreamingParser(str("value"));
JS
publish-jsr:
runs-on: ubuntu-latest
needs: preflight
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
with:
deno-version: v2.x
- name: Publish to JSR
run: deno publish
publish-npm:
runs-on: ubuntu-latest
needs: publish-jsr
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.0
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 26
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Publish to npm
run: npm publish --access public
github-release:
runs-on: ubuntu-latest
needs: [publish-jsr, publish-npm]
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Generate changelog
shell: bash
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
prev_tag="$(
git tag --list "v*" --sort=-version:refname \
| grep -v "^${tag}$" \
| head -n 1 || true
)"
{
echo "# ${tag}"
echo
if [[ -n "${prev_tag}" ]]; then
echo "Changes since ${prev_tag}:"
echo
git log --no-merges --pretty=format:"- %s (%h)" "${prev_tag}..${tag}"
else
echo "Changes:"
echo
git log --no-merges --pretty=format:"- %s (%h)" "${tag}"
fi
echo
} > RELEASE_NOTES.md
- name: Create GitHub release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body_path: RELEASE_NOTES.md