-
Notifications
You must be signed in to change notification settings - Fork 9
44 lines (44 loc) · 1.51 KB
/
publish.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
name: Publish
on:
workflow_run:
workflows: ["CI"]
branches:
- main
types:
- completed
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: check
uses: EndBug/version-check@1d7d917a07973cd80343b97a30ab1feca68dd4c6
with:
static-checking: remoteIsNew
file-url: https://unpkg.com/typedoc-plugin-mdn-links/package.json
- name: Set up Node
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install
if: steps.check.outputs.changed == 'true'
run: npm install
- name: Build
if: steps.check.outputs.changed == 'true'
run: npm run build
- name: Setup publish token
if: steps.check.outputs.changed == 'true'
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish
if: steps.check.outputs.changed == 'true'
run: |
npm publish --non-interactive
git tag v$(jq .version package.json -r)
git push --tags