Skip to content

GABP v1.0.2

GABP v1.0.2 #12

Workflow file for this run

name: Publish gabp-schemas
on:
workflow_dispatch:
inputs:
release_tag:
description: Release tag to publish, for example v1.0.0
required: false
type: string
release:
types: [published]
permissions:
contents: read
jobs:
verify-package:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/js/gabp-schemas
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Setup Node.js
uses: actions/setup-node@v6.3.0
with:
node-version: '24'
cache: npm
cache-dependency-path: packages/js/gabp-schemas/package-lock.json
- name: Install package dependencies
run: npm ci
- name: Run package tests
run: npm test
- name: Verify publishable tarball
run: npm pack --dry-run --json
publish-to-npm:
needs: verify-package
if: |
(github.event_name == 'release' && github.event.release.prerelease == false) ||
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '')
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: packages/js/gabp-schemas
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Setup Node.js
uses: actions/setup-node@v6.3.0
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
cache: npm
cache-dependency-path: packages/js/gabp-schemas/package-lock.json
- name: Verify release tag matches package version
env:
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.release_tag }}
run: |
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
if [ "$RELEASE_TAG" != "v$PACKAGE_VERSION" ]; then
echo "Release tag $RELEASE_TAG does not match package version v$PACKAGE_VERSION" >&2
exit 1
fi
- name: Install package dependencies
run: npm ci
- name: Run package tests
run: npm test
- name: Verify publishable tarball
run: npm pack --dry-run --json
- name: Publish package to npm
run: npm publish --access public