-
Notifications
You must be signed in to change notification settings - Fork 710
45 lines (45 loc) · 1.54 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
45
name: Publish
on:
push:
branches:
- master
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: check
uses: EndBug/version-check@v2.1.4
with:
diff-search: true
- name: Set up Node
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install
if: steps.check.outputs.changed == 'true'
run: npm ci
- name: Test
if: steps.check.outputs.changed == 'true'
run: npm test
- 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
- name: Generate Release
if: steps.check.outputs.changed == 'true'
run: |
git config user.email "typedoc@gerritbirkeland.com"
git config user.name "TypeDoc Bot"
node scripts/create_release.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}