-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 1.95 KB
/
changesets.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
name: Changesets
# .changeset, packages 디렉토리의 변경사항들이 main 브랜치에 push될 때 Action을 실핸한다.
on:
push:
paths:
- ".changeset/**"
branches:
- main
# 단일 실행 및 작업만 진행되도록 할 수 있는 키
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
# 레포지토리에 체크아웃하여 소스를 가져온다.
- name: Checkout branch
uses: actions/checkout@v2
with:
fetch-depth: 0
# 노드 설치
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "lts/*"
# pnpm global install
- name: install pnpm
run: npm i pnpm@latest -g
# 의존성 설치한다.
- name: Install dependencies
run: pnpm install
# 배포를 위해 .npmrc 파일을 생성하고 인증 토큰을 추가한다.
- name: Configure npm
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Changesets에서 제공하는 Action 사용
- name: Create release Pull Request or Publish to Github Packages
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Slack에 빌드 결과 표시
- name: Slack channel notification
uses: 8398a7/action-slack@v3
with:
channel: "#fe-library"
status: ${{ job.status }}
text: ${{steps.tag.outputs.tag}}
fields: message, commit, author
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()