Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dry Run Package

on:
workflow_dispatch:

permissions:
contents: read

jobs:
dry-run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'

- name: Prepare Package Subfolder
run: cp README.md BlinkCard/

- name: Install Dependencies
working-directory: BlinkCard
run: npm install

- name: Execute Dry Run
working-directory: BlinkCard
run: npm publish --access public --dry-run
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish to NPM

on:
push:
tags:
- 'v*' # Triggered on version tag push when creating a GitHub Release

permissions:
id-token: write # Required for npm OIDC Trusted Publishing
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'

- name: Verify tag matches package version
run: |
TAG="${GITHUB_REF_NAME#v}"
PKG=$(node -p "JSON.parse(require('fs').readFileSync('./BlinkCard/package.json')).version")
if [ "$TAG" != "$PKG" ]; then
echo "::error::Tag version (v$TAG) does not match BlinkCard/package.json version ($PKG)"
exit 1
fi
echo "Version match verified: v$TAG"

- name: Prepare Package Subfolder
run: cp README.md BlinkCard/

- name: Install Dependencies
working-directory: BlinkCard
run: npm install

- name: Publish to npm
working-directory: BlinkCard
run: npm publish --access public
Loading