Skip to content

Commit 7f92736

Browse files
committed
feat: update publish workflow to trigger on main branch and adjust permissions
1 parent 174ccb5 commit 7f92736

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ name: Publish
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches:
6+
- main
77

88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: read
13-
id-token: write
12+
contents: write
13+
packages: write
1414

1515
steps:
1616
- uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
1719

1820
- uses: pnpm/action-setup@v4
1921
with:
@@ -22,12 +24,23 @@ jobs:
2224
- uses: actions/setup-node@v4
2325
with:
2426
node-version: 22
25-
registry-url: https://registry.npmjs.org
27+
registry-url: https://npm.pkg.github.com
28+
scope: "@medyll"
2629

2730
- name: Install dependencies
2831
run: pnpm install --frozen-lockfile
2932

33+
- name: Bump patch version
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
npm version patch --no-git-tag-version
38+
VERSION=$(node -p "require('./package.json').version")
39+
git add package.json
40+
git commit -m "chore: release v$VERSION [skip ci]"
41+
git push
42+
3043
- name: Publish
3144
run: pnpm publish --no-git-checks --access public
3245
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)