-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (39 loc) · 1.32 KB
/
Copy pathpublish.yml
File metadata and controls
52 lines (39 loc) · 1.32 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
name: Publish to npm
on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g. 0.1.0, 1.0.0, patch, minor, major)"
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Type check
run: bun run typecheck
- name: Build
run: bun run build
- name: Configure npm auth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Bump version
run: npm version ${{ inputs.version }} --no-git-tag-version
- name: Publish
run: npm publish --access public
- name: Read version
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore: release v${{ steps.version.outputs.version }}"
git tag "v${{ steps.version.outputs.version }}"
git push origin main --tags