forked from matthewjmarangoni/create-kernel-app
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.39 KB
/
Copy pathpublish.yml
File metadata and controls
54 lines (44 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Version Bump
on:
push:
branches:
- main
jobs:
version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for version bumping
ssh-key: ${{ secrets.DEPLOY_KEY }} # Use deploy key to bypass branch protection
- name: Setup Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'github-actions@github.com'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run linting
run: bun run lint
- name: Build
run: bun run build
- name: Bump version and push
run: |
# Use SSH URL for the repository
git remote set-url origin git@github.com:${GITHUB_REPOSITORY}.git
# Bump version
npm version patch -m "chore: bump version to %s [skip ci]"
# Push directly to main
git push origin HEAD:main --tags
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}