-
Notifications
You must be signed in to change notification settings - Fork 87
63 lines (49 loc) · 1.52 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
name: Release
env:
GITHUB_TOKEN: ${{ secrets.SELF_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_BRANCH: ${{ github.ref_name }}
on:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Dependencies
run: pnpm install --no-frozen-lockfile
- name: Build Packages
run: pnpm build
- name: Fetch Github User Email & Name
run: |
git config --global user.email $(git log -n 1 --pretty=format:%ae)
git config --global user.name $(git log -n 1 --pretty=format:%an)
- name: Generate changelogrc
run: pnpm changelog:gen
- name: Bump version
run: pnpm changeset version
- name: Publish packages and create releases
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
pnpm changeset:publish
- name: Generate changelog files
run: pnpm changelog:write
- name: Commit changelog files
run: |
git add . && git diff --staged --quiet || git commit -am "docs: 📝 update changelog on repository" && git push origin $GITHUB_BRANCH