-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (44 loc) · 1.43 KB
/
cd.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
name: Continuous Delivery
on: workflow_dispatch
jobs:
publish:
name: Publish package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2.4.0
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Restore Node.js modules
uses: actions/cache@v2.1.6
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Build package
run: yarn build
- name: Publish package
run: yarn publish --non-interactive --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get package version
id: get-package-version
run: echo "::set-output name=version::$(yarn -s get-version)"
- name: Get changelog
id: get-changelog
run: echo "::set-output name=changelog::$(yarn -s gen-version)"
- name: Publish GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get-package-version.outputs.version }}
release_name: v${{ steps.get-package-version.outputs.version }}
body: |
${{ steps.get-changelog.outputs.changelog }}
draft: false
prerelease: false