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
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Publish to npm

on:
release:
types: [published, released, created]
types: [published, released, created, edited]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.actor == github.repository_owner
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -54,11 +54,11 @@ jobs:
npm version ${{ github.event.inputs.version_type }} --no-git-tag-version
NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT

# Commit the version change
git add package.json package-lock.json
git commit -m "chore: bump version to v$NEW_VERSION"

# Create and push tag
git tag "v$NEW_VERSION"
git push origin main
Expand All @@ -71,7 +71,12 @@ jobs:
--notes "## Changes

See the [changelog](https://github.com/${{ github.repository }}/compare/v${{ steps.version.outputs.new_version }}...HEAD) for details.

**Full Changelog**: https://github.com/${{ github.repository }}/commits/v${{ steps.version.outputs.new_version }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger npm publish
run: gh workflow run publish.yml
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}