-
Notifications
You must be signed in to change notification settings - Fork 34
45 lines (43 loc) · 1.33 KB
/
test.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
name: ci
on:
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '18', cache: 'yarn'}
- run: yarn
- run: yarn test
- uses: nowsprinting/check-version-format-action@v3
id: version
with: {prefix: 'v'}
- if: steps.version.outputs.is_valid == 'true'
run: |
rm -r dist
yarn bump ${GITHUB_REF#refs/tags/v}
npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_AUTH_TOKEN}}
- if: steps.version.outputs.is_stable == 'true'
run: npm publish
- if: steps.version.outputs.prerelease
run: npm publish --tag preview
- if: steps.version.outputs.is_stable == 'true'
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
with:
changelog_file: changelog.md
- if: steps.version.outputs.is_stable == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
body: ${{ steps.extract-release-notes.outputs.release_notes }}