diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 24dd066..9278a25 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41cacf2..7f1ed5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: if: github.actor == github.repository_owner permissions: contents: write - + steps: - name: Checkout code uses: actions/checkout@v4 @@ -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 @@ -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 }} \ No newline at end of file