Skip to content

Commit 1f9269f

Browse files
committed
add changesets
1 parent b4ce99e commit 1f9269f

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Publish Package to npmjs
22
on:
33
push:
4-
tags:
5-
- '**[0-9]+.[0-9]+.[0-9]+*'
4+
branches:
5+
- main
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
packages: write
13+
id-token: write
614

715
jobs:
816
build:
@@ -20,19 +28,21 @@ jobs:
2028
version: 10
2129

2230
- name: Setup Node.js
23-
uses: actions/setup-node@v4
31+
uses: actions/setup-node@v6
2432
with:
25-
node-version: '22.x'
33+
node-version: 24
2634
cache: 'pnpm'
2735
registry-url: 'https://registry.npmjs.org/'
2836
scope: '@pomsky-lang'
2937

30-
- run: pnpm install
38+
- run: pnpm install --frozen-lockfile
3139

32-
- name: Check current npm config
33-
run: npm config list
34-
35-
- run: pnpm publish --access public --no-git-checks
40+
- name: Create Release Pull Request or Publish
41+
id: changesets
42+
uses: changesets/action@v1
43+
with:
44+
publish: pnpm run ci:publish
3645
env:
3746
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38-
NPM_CONFIG_PROVENANCE: true
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@
3232
"files": [
3333
"dist"
3434
],
35+
"publishConfig": {
36+
"provenance": true,
37+
"access": "public"
38+
},
3539
"scripts": {
3640
"lint": "biome lint",
3741
"test": "vitest",
3842
"build": "rm -rf out dist && tsc && rollup -c rollup.config.js",
39-
"prepublish": "pnpm run build"
43+
"release": "changeset",
44+
"ci:publish": "pnpm build && changeset publish --access public"
4045
},
4146
"devDependencies": {
4247
"@biomejs/biome": "^1.9.4",

0 commit comments

Comments
 (0)