Skip to content

Commit e884ce3

Browse files
committed
ci: auto publish on develop
1 parent 18e3ce7 commit e884ce3

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Use Node.js 18
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
registry-url: https://npm.pkg.github.com/
27+
scope: '@omarsdev'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Run tests
33+
run: npm test --if-present
34+
35+
- name: Configure git user
36+
run: |
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
40+
- name: Bump package version
41+
run: npm version patch -m "chore: release %s"
42+
43+
- name: Publish to GitHub Packages
44+
run: npm publish
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_PACKAGES_TOKEN }}
47+
48+
- name: Push version bump
49+
run: |
50+
git push origin HEAD:develop --follow-tags

0 commit comments

Comments
 (0)