-
Notifications
You must be signed in to change notification settings - Fork 93
48 lines (45 loc) · 1.5 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
48
# 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
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18']
# 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: Check Git Status
run: git status
- name: Build and release tag
run: npm run release
env:
GIT_AUTHOR_NAME: 'kenjdavidson'
GIT_AUTHOR_EMAIL: 'ken.j.davidson@live.ca'
GIT_COMMITTER_NAME: 'kenjdavidson'
GIT_COMMITTER_EMAIL: 'ken.j.davidson@live.ca'
- 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 }}