-
Notifications
You must be signed in to change notification settings - Fork 9
54 lines (52 loc) · 1.92 KB
/
ci.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
name: CI
on:
push:
branches:
- 'main'
- 'beta'
- 'alpha'
pull_request:
branches:
- '**'
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Toss Payments 공통 설정
uses: ./.github/actions/configure
with:
npm_token: ${{ secrets.NPM_TOKEN }}
- name: Node.js 환경 설정
uses: actions/setup-node@v3
with:
node-version: 18
- name: 'SINCE_FROM_REF 환경변수 설정'
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
echo "SINCE_FROM_REF=$(git rev-parse HEAD~1)" >> $GITHUB_ENV
elif [[ ${{ github.ref }} == 'refs/heads/staging'* ]]; then
echo "SINCE_FROM_REF=$(git rev-parse HEAD~1)" >> $GITHUB_ENV
elif [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "SINCE_FROM_REF=$(git rev-parse origin/${{ github.base_ref }})" >> $GITHUB_ENV
else
echo "SINCE_FROM_REF=$(git rev-parse origin/main)" >> $GITHUB_ENV
fi
- name: yarn install
run: yarn install --immutable
- name: Run Test
run: yarn workspaces since run test $SINCE_FROM_REF --jobs=5
- name: 릴리즈
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/alpha'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# 지정한 버전으로 배포하기 위해 임시로 CI package version up을 생략합니다
run: yarn lerna publish from-package --yes --concurrency=2
# TODO: v2 배포 후 아래 스크립트로 다시 변경
# run: |
# yarn lerna version --conventional-commits --exclude-dependents --yes --git-remote origin
# yarn lerna publish from-git --yes --concurrency=2