Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(release): automatic version bump #67

Merged
merged 2 commits into from
Jan 10, 2024
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
13 changes: 13 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Publish on Release

permissions:
contents: write

on:
release:
types: [created]
Expand All @@ -18,6 +21,16 @@ jobs:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- name: Bump package.json version
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
git tag --delete ${{github.ref_name}}
git push --delete origin ${{github.ref_name}}
git checkout -b tmp
yarn version --new-version `echo -n ${{github.ref_name}} | tr -d "v"` --no-commit-hooks
git push origin tmp:main
git push origin ${{github.ref_name}}
- run: yarn npm publish --access public
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}