-
Notifications
You must be signed in to change notification settings - Fork 469
109 lines (92 loc) · 3.4 KB
/
release.yml
File metadata and controls
109 lines (92 loc) · 3.4 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Release CI
on:
push:
branches:
- 'release/[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: macOS-latest
permissions:
contents: write
pull-requests: write
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure git user
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './common/config/rush/pnpm-lock.yaml'
- name: Install rush
run: node common/scripts/install-run-rush.js install --bypass-policy
- name: Parse semver version from branch name
id: semver_parser
uses: xile611/read-package-version-action@main
with:
path: packages/vtable
semver_string: ${{ github.ref_name }}
semver_pattern: '^release/(.*)$'
- name: Update nextBump of version policies
uses: xile611/set-next-bump-of-rush@main
with:
release_version: ${{ steps.semver_parser.outputs.full }}
write_next_bump: true
- name: Update version
run: node common/scripts/install-run-rush.js version --bump
- name: Build packages
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NO_EMIT_ON_ERROR: 'true'
run: |
export NODE_OPTIONS="--max_old_space_size=4096"
export NO_EMIT_ON_ERROR="true"
node common/scripts/install-run-rush.js build --only tag:package 2>&1 | tee build.log || {
echo "=== Build failed, showing last 1000 lines of build.log ==="
tail -n 1000 build.log
echo "=== Full error details ==="
grep -A 50 "TypeScript Compilation Errors" build.log || true
grep -A 50 "Build Error" build.log || true
exit 1
}
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: node common/scripts/install-run-rush.js publish --publish --include-all
- name: Update shrinkwrap
run: node common/scripts/install-run-rush.js update
- name: Get npm version
id: package-version
uses: xile611/read-package-version-action@v2.1
with:
path: packages/vtable
- name: Commit and push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}'
branch: ${{ github.ref_name }}
- name: Collect changelog of rush
uses: xile611/collect-rush-changlog@main
id: changelog
with:
version: ${{ steps.package-version.outputs.current_version }}
- name: Create Pull Request
uses: dustinirving/create-pr@v1.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: '[Auto release] release ${{ steps.package-version.outputs.current_version }}'
base: main
head: ${{ github.ref_name }}
labels: release
reviewers: fangsmile,Rui-Sun
body: |
${{ steps.changelog.outputs.markdown }}