-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (84 loc) · 2.49 KB
/
cd.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
85
86
87
name: CD
on:
push:
branches:
- master
workflow_dispatch:
inputs:
release-type:
type: choice
description: Release Type
options:
- prerelease
- patch
- minor
- major
jobs:
# check:
# strategy:
# matrix:
# os: [ubuntu-latest]
# node: [16, 18]
# include:
# - os: windows-latest
# node: 16
# npm: 6
# - os: macos-latest
# node: 16
# npm: 6
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: actions/cache@v3
# name: Cache node modules
# id: yarn-cache
# with:
# path: |
# .yarn/cache
# **/node_modules
# key: ${{ matrix.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ matrix.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# - run: yarn
# - run: yarn cd:check
release:
# needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
name: Cache node modules
id: yarn-cache
with:
path: |
.yarn/cache
**/node_modules
key: ubuntu-latest-16-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
ubuntu-latest-16-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- name: Release packages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
MANUAL_RELEASE_TYPE: ${{ github.event.inputs.release-type }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
echo "@whu-court:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> .npmrc
npm whoami
yarn cd:release