Skip to content

Commit 627d3a6

Browse files
chore: release packages to npm on tags (jspm#18)
1 parent 997ab3e commit 627d3a6

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
publish:
10+
name: Publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup Node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: "16.x"
18+
- name: Setup Chomp
19+
uses: guybedford/chomp-action@v1
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Installing Dependencies
23+
run: npm install
24+
- name: Build package
25+
run: chomp build
26+
- name: Run tests
27+
run: chomp test
28+
- name: Authenticate with Registry
29+
env:
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
run: |
32+
npm logout
33+
echo "@jspm:registry=https://registry.npmjs.org/" > .npmrc
34+
echo "registry=https://registry.npmjs.org/" >> .npmrc
35+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
36+
npm whoami
37+
38+
- name: Publish to npm
39+
env:
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
run: npm publish --yes

0 commit comments

Comments
 (0)