diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ca27d7..0a5754e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,3 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages - name: NPM Publish on: @@ -9,7 +6,7 @@ on: permissions: id-token: write # Required for OIDC - contents: read + contents: write # Required to push version bump commit jobs: publish-npm: @@ -22,6 +19,17 @@ jobs: registry-url: https://registry.npmjs.org/ - run: npm install -g npm@latest - run: npm ci --ignore-scripts --no-audit --no-fund + - name: Bump version in package.json + run: | + VERSION="${{ github.event.release.tag_name }}" + npm version "${VERSION#v}" --no-git-tag-version + - name: Commit and push version bump + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add package.json package-lock.json + git commit -m "chore: bump version to ${{ github.event.release.tag_name }}" + git push origin HEAD:main - run: npx playwright install chromium --only-shell - run: npm test -- --forbid-only - run: npm run build