-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.21 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
name: publish
on:
push:
tags:
- v*
permissions:
contents: read
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # Important for changelog
filter: blob:none # We don't need all blobs
- run: corepack enable
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: .node-version
registry-url: https://registry.npmjs.org/
- run: pnpm install
- run: echo VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_ENV
- run: pnpm version ${VERSION}
- name: Generate changelog with git-cliff
uses: tj-actions/git-cliff@v1.4.2
with:
args: --latest --strip all
output: 'CHANGELOG.md'
- run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
bodyFile: 'CHANGELOG.md'
name: ${{ env.VERSION }}
prerelease: ${{ contains(github.ref_name, '-') }}