forked from IBM/beacon-for-ibm-dotcom
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.11 KB
/
Copy pathpublish.yml
File metadata and controls
41 lines (39 loc) · 1.11 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
name: publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: yarn install
- name: Publish to NPM
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: false
- name: Create changelog
if: steps.publish.outputs.version != steps.publish.outputs['old-version']
env:
INPUT_TOKEN: ''
run: |
npm install -g conventional-changelog-cli
conventional-changelog -r 1 >> CHANGELOG.md
- name: Create Github Release
if: steps.publish.outputs.version != steps.publish.outputs['old-version']
uses: ncipollo/release-action@v1
with:
bodyFile: "CHANGELOG.md"
tag: v${{ steps.publish.outputs.version }}
commit: main
token: ${{ secrets.GITHUB_TOKEN }}