Skip to content

Commit 1c3cac0

Browse files
Merge pull request #6 from savetheclocktower/publish-to-npm
Set up CI publishing pipeline to NPM
2 parents 69ca346 + e1e6655 commit 1c3cac0

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: NPM Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
env:
9+
NODE_VERSION: 16
10+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ env.NODE_VERSION }}
20+
- run: npm ci
21+
- run: npm test
22+
23+
publish:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ env.NODE_VERSION }}
31+
registry-url: https://registry.npmjs.org/
32+
- run: npm ci
33+
- run: npm publish --access public

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ node_modules
3535

3636
# Local-only
3737
local
38+
39+
# `clangd` cache files
40+
.cache

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
# See the root package.json's "files" for what is included.
33
# npm5 ignores empty .npmignore files so add something trivial.
44
/node_modules
5+
.travis.yml
6+
.last-synced-commit
7+
.github
8+
npm-debug.log

0 commit comments

Comments
 (0)