Skip to content
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Npm Publish

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.release.tag_name }}

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build package
run: |
bun run prepare
bun run build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최근 작업한 내역에서 app 빌드와 lib 빌드과 나누어져 명령어가 bun run build:lib 로 변경되었습니다.

참고 PR입니다.
#685

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

64c964c에서 반영되었습니다!


- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ -z "${NODE_AUTH_TOKEN}" ]; then
echo "Error: NPM_TOKEN이 설정되지 않았습니다."
exit 1
fi
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc

TAG_NAME="${{ github.event.release.tag_name }}"
VERSION=${TAG_NAME#v}
echo "버전 ${VERSION} 배포를 시작합니다..."

npm publish --access public
echo "npm 배포가 완료되었습니다."