-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 2.8 KB
/
pipeline.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Node.js Package
on:
push:
branches: [master]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v2
- name: Install
run: npm ci
- name: Build
run: |
npm run build
cp package.json ./dist/
cp README.md ./dist/
- name: Test
run: npm run citest
- name: Upload Build Artifact
uses: actions/[email protected]
with:
path: ./dist
publish-dev:
if: ${{ github.event_name == 'pull_request' }}
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Download Build Artifact
uses: actions/[email protected]
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@tfso'
- name: Publish prerelease to GitHub Packages
working-directory: ./artifact
run: |
npm version prerelease --preid=branch.${{github.run_number}} --no-git-tag-version
npm publish --verbose --tag dev
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
changelog:
if: ${{ github.ref == 'refs/heads/master' }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Install
run: npm ci
# Creates tags and updates changelog based on change changelog-config.js settings
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
config-file-path: ./changelog-config.js
- name: Fail if tagging is skipped
if: ${{ steps.changelog.outputs.skipped == 'true' }}
run: exit 1
- name: Download Build Artifact
uses: actions/[email protected]
- name: Copy package.json to artifact
run: cp package.json ./artifact/package.json
- name: Upload Build Artifact
uses: actions/[email protected]
with:
path: ./artifact
publish-prod:
if: ${{ github.ref == 'refs/heads/master' }}
needs: changelog
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Download Build Artifact
uses: actions/[email protected]
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@tfso'
- name: Publish to Github Packages
working-directory: ./artifact
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}