-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (36 loc) · 1.02 KB
/
publish.yml
File metadata and controls
38 lines (36 loc) · 1.02 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
name: Publish to npm
on:
workflow_run:
workflows: ["Main"]
types:
- completed
branches: [ "main" ]
jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
- uses: oven-sh/setup-bun@v1
- run: bun install
- name: update changelog
run: |
if bun run update-changelog; then
echo "changelog updated"
else
echo "skipping publish because no changes were detected"
exit 1
fi
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push tags
run: |
git config --local user.name "github-actions"
git config --local user.email "github-actions@users.noreply.github.com"
git push origin main --tags