-
-
Notifications
You must be signed in to change notification settings - Fork 18
86 lines (71 loc) · 2.35 KB
/
release-please.yaml
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
# The 'release-please' workflow is used to create the 'Release Please' pull
# request. This PR is opened when we have a new commit to main.
# See:
# https://github.com/googleapis/release-please
name: CI main
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Report coverage
run: npm run report-coverage
- name: Store coverage artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
./artifacts/**/*.*
release-please:
runs-on: ubuntu-latest
needs: 'test'
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: wait-port
# If the 'release please' action has been performed, we can actually
# deploy the website.
# Note: *every* step here needs to check the 'release_created' flag.
- name: Checkout
uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
# Setup the right version of Node.js.
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '*'
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- name: Install dependencies
run: npm ci
if: ${{ steps.release.outputs.release_created }}
# Fixup Git URLs, see:
# https://stackoverflow.com/questions/70663523/the-unauthenticated-git-protocol-on-port-9418-is-no-longer-supported
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}