-
Notifications
You must be signed in to change notification settings - Fork 94
47 lines (44 loc) · 1.49 KB
/
release-and-publish-npm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Release and Publish to NPM
# Triggered manually (at this point) from a specified branch/tag will perform the `npm run release`
name: release-and-publish-npm
# Run on workflow dispatch
# Currently no custom input
on:
workflow_dispatch:
jobs:
build:
# Runs on Ubuntu-latest
# with node version(s) 12.16.3
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['12.16.3']
# Checks out the appropriate branch (github.ref)
# Creates release tag
# Publishes release tag (ish, actually the current ref but on which the tag was based)
# Todo: fixup
steps:
- name: Checking out ${{ github.ref_name }}
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build and release tag
run: npm run release
env:
GIT_AUTHOR_NAME: 'kenjdavidson'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: 'kenjdavidson'
GIT_COMMITTER_EMAIL: '[email protected]'
- name: Publish released tag to NPM
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}