|
| 1 | +name: Create Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + create-release: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Get current version |
| 20 | + id: version |
| 21 | + run: | |
| 22 | + VERSION=$(node -p "require('./public/manifest.json').version") |
| 23 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 24 | + echo "tag=v$VERSION" >> $GITHUB_OUTPUT |
| 25 | +
|
| 26 | + - name: Check if release exists |
| 27 | + id: check_release |
| 28 | + run: | |
| 29 | + if git ls-remote --tags origin | grep -q "refs/tags/${{ steps.version.outputs.tag }}"; then |
| 30 | + echo "exists=true" >> $GITHUB_OUTPUT |
| 31 | + echo "Release ${{ steps.version.outputs.tag }} already exists, skipping..." |
| 32 | + else |
| 33 | + echo "exists=false" >> $GITHUB_OUTPUT |
| 34 | + echo "Creating new release ${{ steps.version.outputs.tag }}..." |
| 35 | + fi |
| 36 | +
|
| 37 | + - name: Setup pnpm |
| 38 | + if: steps.check_release.outputs.exists == 'false' |
| 39 | + uses: pnpm/action-setup@v4 |
| 40 | + with: |
| 41 | + version: 9 |
| 42 | + |
| 43 | + - name: Setup Node.js |
| 44 | + if: steps.check_release.outputs.exists == 'false' |
| 45 | + uses: actions/setup-node@v4 |
| 46 | + with: |
| 47 | + node-version: "20" |
| 48 | + cache: "pnpm" |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + if: steps.check_release.outputs.exists == 'false' |
| 52 | + run: pnpm install |
| 53 | + |
| 54 | + - name: Build extension |
| 55 | + if: steps.check_release.outputs.exists == 'false' |
| 56 | + env: |
| 57 | + VITE_GA_API_SECRET: ${{ secrets.VITE_GA_API_SECRET }} |
| 58 | + run: tsc -b && pnpm exec vite build --mode production |
| 59 | + |
| 60 | + - name: Create dist.zip |
| 61 | + if: steps.check_release.outputs.exists == 'false' |
| 62 | + run: | |
| 63 | + cd dist |
| 64 | + zip -r ../dist.zip . |
| 65 | + cd .. |
| 66 | +
|
| 67 | + - name: Create Release |
| 68 | + if: steps.check_release.outputs.exists == 'false' |
| 69 | + uses: softprops/action-gh-release@v2 |
| 70 | + with: |
| 71 | + tag_name: ${{ steps.version.outputs.tag }} |
| 72 | + name: Release ${{ steps.version.outputs.version }} |
| 73 | + body: | |
| 74 | + ## LinKU ${{ steps.version.outputs.version }} |
| 75 | +
|
| 76 | + 자동 생성된 릴리스입니다. |
| 77 | +
|
| 78 | + ### 설치 방법 |
| 79 | + 1. dist.zip 파일을 다운로드하고 압축을 풉니다 |
| 80 | + 2. Chrome 확장 프로그램 페이지에서 "개발자 모드"를 활성화합니다 |
| 81 | + 3. "압축해제된 확장 프로그램을 로드합니다"를 클릭하고 압축 해제한 폴더를 선택합니다 |
| 82 | + files: | |
| 83 | + dist.zip |
| 84 | + draft: false |
| 85 | + prerelease: false |
0 commit comments