Skip to content

Commit

Permalink
publish to npm registry has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamkou committed Oct 29, 2021
1 parent b69d525 commit a19481e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ jobs:
# version 5 is glitching

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test

49 changes: 49 additions & 0 deletions .github/workflows/publish-to-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish to NPM registry

on:
release:
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: artifacts
run: |
mkdir /tmp/output
mv -t /tmp/output lib typings README.md LICENSE package.json
- uses: actions/upload-artifact@v2
with:
name: artifacts
path: /tmp/output

publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v1
with:
node-version: 'lts/*'

- uses: actions/download-artifact@v2
with:
name: artifacts
path: artifacts

- name: list
run: ls -R
working-directory: artifacts

- name: publish
run: npm publish
working-directory: artifacts
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- uses: geekyeggo/delete-artifact@v1
with:
name: artifacts

0 comments on commit a19481e

Please sign in to comment.