Skip to content
Merged
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
25 changes: 16 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

permissions:
contents: read
contents: write
id-token: write

jobs:
Expand All @@ -22,14 +22,21 @@ jobs:
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Update package.json version from release tag
uses: cssnr/[email protected] # Use the latest version of the action
with:
# Optional: Commit the changes back to the repository (defaults to true)
commit: false

# Optional: Push the changes back to the repository (defaults to true)
push: false
- name: Extract version from tag
id: get_version
run: |
# Get the tag name (e.g., v1.0.1)
TAG_NAME="${{ github.event.release.tag_name }}"
# Remove 'v' prefix if present
VERSION="${TAG_NAME#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Extracted version: ${VERSION}"

- name: Update package.json version
run: |
VERSION="${{ steps.get_version.outputs.version }}"
npm version ${VERSION} --no-git-tag-version
echo "Updated package.json to version ${VERSION}"

# Ensure npm 11.5.1 or later is installed
- name: Update npm
Expand Down