Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Publish Plugin to NPM
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "wwv-plugin-*-v*" # e.g. wwv-plugin-aviation-v1.0.1
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
id-token: write # Required for OIDC trusted publishing (no NPM_TOKEN needed)
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Detect package name from tag
|
|
id: pkg
|
|
run: |
|
|
TAG="${{ github.ref_name }}"
|
|
# Strips the -vX.Y.Z suffix: "wwv-plugin-aviation-v1.0.1" → "wwv-plugin-aviation"
|
|
PKG=$(echo "$TAG" | sed 's/-v[0-9].*//')
|
|
echo "package=$PKG" >> $GITHUB_OUTPUT
|
|
echo "Publishing: $PKG"
|
|
|
|
- name: Build package
|
|
run: npm run build -w packages/${{ steps.pkg.outputs.package }}
|
|
|
|
- name: Publish to NPM (OIDC)
|
|
run: npm publish packages/${{ steps.pkg.outputs.package }} --access public --provenance
|