Skip to content

Commit 67192d9

Browse files
committed
ci: draft releases, publish npm on release publish
1 parent 3f60b53 commit 67192d9

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
registry-url: "https://registry.npmjs.org"
17+
18+
- name: Publish npm package
19+
working-directory: npm
20+
run: |
21+
VERSION="${{ github.event.release.tag_name }}"
22+
VERSION="${VERSION#v}"
23+
npm version "$VERSION" --no-git-tag-version
24+
npm publish --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,3 @@ jobs:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
3333

34-
- name: Setup Node
35-
if: env.NPM_TOKEN != ''
36-
uses: actions/setup-node@v4
37-
with:
38-
node-version: 20
39-
registry-url: "https://registry.npmjs.org"
40-
env:
41-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42-
43-
- name: Publish npm package
44-
if: env.NPM_TOKEN != ''
45-
working-directory: npm
46-
run: |
47-
VERSION="${GITHUB_REF_NAME#v}"
48-
npm version "$VERSION" --no-git-tag-version
49-
npm publish --access public
50-
env:
51-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ checksum:
3131
name_template: checksums.txt
3232

3333
release:
34-
draft: false
34+
draft: true
3535

3636
brews:
3737
- repository:

0 commit comments

Comments
 (0)