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
14 changes: 10 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Publish to npm
on:
push:
branches: [main]
workflow_dispatch: {}

concurrency:
group: publish
Expand All @@ -17,6 +18,9 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Full history + stay on the branch so the bump step can rebase + push.
fetch-depth: 0
ref: main

- uses: pnpm/action-setup@v4
with:
Expand All @@ -33,11 +37,13 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
npm version patch --no-git-tag-version
VERSION=$(node -p "require('./package.json').version")
# Re-base onto the latest main first so a re-run or a race never hits a
# non-fast-forward push (the old failure mode).
git pull --rebase origin main
VERSION=$(npm version patch --no-git-tag-version)
git add package.json
git commit -m "chore: bump version to $VERSION [skip ci]"
git push
git commit -m "chore: bump version to ${VERSION} [skip ci]"
git push origin HEAD:main

- run: pnpm build

Expand Down
Loading