-
Notifications
You must be signed in to change notification settings - Fork 57
49 lines (40 loc) · 1.4 KB
/
Copy pathpush-main.yml
File metadata and controls
49 lines (40 loc) · 1.4 KB
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
name: Main workflow
on:
push:
branches:
- main
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
# Entire history is required for commitlint action
fetch-depth: 0
# Commits in master must be semver for "Release Please"
- name: Lint commits
uses: wagoid/commitlint-github-action@v3
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'
- name: Install deps
run: npm ci
- name: Validate
run: npm run validate
# This action will usually create (or update) a "release" PR, containing a version bump and changelog updates
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
# If the above action creates a GitHub release, then also publish to npm
# This must be attached to this workflow, as one workflow cannot trigger another (e.g. on release create)
- name: Publish to npm
if: ${{ steps.release.outputs.release_created }}
# Public access required because scoped packages (@example/lib) are private by default
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}