-
Notifications
You must be signed in to change notification settings - Fork 99
77 lines (65 loc) · 2.16 KB
/
release.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
name: Release
on:
pull_request:
types:
- closed
branches:
- master
jobs:
if_merged:
if: startsWith(github.head_ref, 'release/') && github.event.pull_request.merged == true
name: Publish packages
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Test
run: echo $HOME ${{ github.ref }} ${{ github.head_ref }} ${{ github.event.pull_request.merged }}
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Node.js 14.21.x
uses: actions/setup-node@v4
with:
node-version: 14.21.x
cache: 'yarn'
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Install dependencies
run: |
yarn config set strict-ssl false
yarn
- name: Build packages
run: |
yarn run build
- name: Publish
run: |
yarn run publish
git checkout -- .npmrc
git push origin --follow-tags
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Read Version
id: package
uses: rexdefuror/[email protected]
with:
file: package.json
path: ./packages/ui/hiui
- name: Read ChangeLog
id: changelog
uses: BinPar/[email protected]
with:
changelog-path: ./packages/ui/hiui/CHANGELOG.md
version: ${{ env.PACKAGE_VERSION }}
- name: Create Release Log
uses: ncipollo/release-action@v1
with:
# This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object.
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
tag: "@hi-ui/hiui@${{ env.PACKAGE_VERSION }}"
name: ${{ env.PACKAGE_VERSION }}
body: ${{ steps.changelog.outputs.version-changelog }}
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}