Skip to content

Commit cb726ab

Browse files
ci: publish package to GitHub Packages
1 parent 968bc4d commit cb726ab

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
3+
name: Publish package to GitHub Packages
4+
5+
on: [push]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.14.0'
18+
registry-url: 'https://npm.pkg.github.com'
19+
- run: yarn install
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- run: yarn test
23+
- run: yarn build
24+
- if: github.ref == 'refs/heads/main'
25+
run: yarn publish
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build": "yarn tsc",
77
"format": "prettier --write \"**/*.{js,json,ts,tsx}\"",
88
"start": "yarn node dist/index.js",
9-
"test:types": "yarn tsc",
9+
"test:types": "yarn tsc --noEmit",
1010
"test": "yarn test:types"
1111
},
1212
"bin": "dist/start.js",

0 commit comments

Comments
 (0)