-
Notifications
You must be signed in to change notification settings - Fork 12
45 lines (37 loc) · 1.05 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
name: "[PUBLISH] NewsFragments"
on:
push:
tags:
- "*"
permissions:
contents: write
packages: read
jobs:
npm-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm install
- run: npm run lint
- run: npm test
- id: "publish"
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
- if: steps.publish.type != 'none'
run: |
echo "Version changed: ${{ steps.publish.old-version }} => ${{ steps.publish.version }}"
- if: steps.publish.type == 'none'
run: |
echo "Version not changed."
- name: Get current tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Generate release changelog
run: ./src/cli/index.js preview -p $RELEASE_VERSION >> release.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: release.txt