Skip to content

docs(readme): revise for 2.0 — tone, headings, tables, code samples #1

docs(readme): revise for 2.0 — tone, headings, tables, code samples

docs(readme): revise for 2.0 — tone, headings, tables, code samples #1

Workflow file for this run

name: Release
# Fires when a tag like v2.0.0 is pushed. Validates the tag matches
# package.json, runs the full CI sweep, publishes to npm with provenance
# (OIDC via Trusted Publisher — no NPM_TOKEN needed), then opens a GitHub
# Release with auto-generated notes.
#
# One-time setup required on npmjs.com before this can fire:
# npmjs.com -> Package settings -> "Trusted publisher" ->
# repo: devbridge/jQuery-Autocomplete
# workflow: release.yml
# environment: npm-publish
# See https://docs.npmjs.com/trusted-publishers
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
environment: npm-publish
permissions:
id-token: write # OIDC token for npm provenance
contents: write # creating the GitHub Release
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- name: Verify tag matches package.json version
run: |
tag_version="${GITHUB_REF_NAME#v}"
pkg_version="$(node -p "require('./package.json').version")"
if [ "$tag_version" != "$pkg_version" ]; then
echo "Tag $GITHUB_REF_NAME does not match package.json version $pkg_version" >&2
exit 1
fi
- run: npm run lint
- run: npm run format:check
- run: npm run typecheck
- run: npm test
- run: npm run build
- run: npm publish --provenance --access public
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "$GITHUB_REF_NAME" --generate-notes --verify-tag