Skip to content

v1.0.880

v1.0.880 #56

Workflow file for this run

name: 'Release'
on:
release:
types: [created]
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: release
cancel-in-progress: false
jobs:
publish:
name: 'Publish to npm'
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && !github.event.release.draft)
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.14.0
registry-url: 'https://registry.npmjs.org'
- name: Setup Dependencies
run: |
corepack enable
npm install
- name: Validate release tag
if: github.event_name == 'release'
run: |
package_version=$(node -p "require('./package.json').version")
expected_tag="v${package_version}"
actual_tag="${{ github.event.release.tag_name }}"
if [ "$actual_tag" != "$expected_tag" ]; then
echo "Release tag $actual_tag does not match package version $expected_tag"
exit 1
fi
- name: Build package
run: npm run build
- name: Publish package
run: npm publish --access public