generated from ericvera/ts-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.5 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Node version
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: yarn
- name: Lint
run: yarn lint
- name: Run tests
run: yarn test
- name: Build
run: yarn build
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
# Do not generate the CHANGELOG.md. Changelog details will be included
# in the release notes.
output-file: 'false'
github-token: ${{ github.token }}
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
allowUpdates: true
draft: false
name: ${{ steps.changelog.outputs.tag }}
tag: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
token: ${{ github.token }}