-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (75 loc) · 2.29 KB
/
nodejs.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
name: Node.js CI
on:
push:
branches: [ main, develop ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ main, develop ]
paths-ignore:
- '**/*.md'
jobs:
lint:
name: Typescript lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint
githubRelease:
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push'}}
name: Release new version to GitHub
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v2
- name: Conventional Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file: 'CHANGELOG.md'
tag-prefix: 'v'
release-count: 0
fallback-version: '1.0.0'
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
- name: Sync develop with main
uses: repo-sync/pull-request@v2
with:
source_branch: "main"
destination_branch: "develop"
pr_title: "Synchronize develop with master after release ${{ steps.changelog.outputs.tag }}"
pr_body: ":crown:"
pr_assignee: "alesancor1"
pr_label: "auto-pr"
github_token: ${{ secrets.GITHUB_TOKEN }}
npmRelease:
name: Publish new release to npm registry
needs: githubRelease
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'main'
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}