chore: browser SDK의 패키지들을 지정한 버전으로 배포되도록 합니다 #231
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |