-
-
Notifications
You must be signed in to change notification settings - Fork 404
84 lines (71 loc) · 2.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Publish
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetching tags
run: git fetch --tags -f || true
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get yarn cache directory
id: yarn-cache
run: |
echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install
env:
PUPPETEER_SKIP_DOWNLOAD: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build
run: yarn build
- name: Publish in NPM
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Generate Changelog
id: generate_changelog
run: |
changelog=$(npm run changelog:last --silent)
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo -e "set-output name=changelog::${changelog-<empty>}\n"
echo -e "::set-output name=changelog::${changelog}\n"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.generate_changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Build Swagger Page
run: yarn swagger:generate
- name: Deploy Page
uses: peaceiris/actions-gh-pages@v4
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./swagger-docs