Merge pull request #55 from songeunseo/main #17
This file contains hidden or 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: Upload Chrome Extension Draft | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| upload-draft: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Update version | |
| run: node scripts/updateVersion.js | |
| - name: Build extension | |
| env: | |
| VITE_GA_API_SECRET: ${{ secrets.VITE_GA_API_SECRET }} | |
| run: tsc -b && pnpm exec vite build --mode production | |
| - name: Create extension zip | |
| run: | | |
| cd dist | |
| zip -r ../extension.zip . | |
| cd .. | |
| - name: Install chrome-webstore-upload-cli | |
| run: npm install -g chrome-webstore-upload-cli | |
| - name: Upload to Chrome Web Store (Draft only) | |
| run: | | |
| chrome-webstore-upload upload \ | |
| --source extension.zip \ | |
| --extension-id ${{ secrets.CHROME_EXTENSION_ID }} \ | |
| --client-id ${{ secrets.CHROME_CLIENT_ID }} \ | |
| --client-secret ${{ secrets.CHROME_CLIENT_SECRET }} \ | |
| --refresh-token ${{ secrets.CHROME_REFRESH_TOKEN }} | |
| - name: Commit and push version update | |
| run: | | |
| # Git 설정 | |
| git config --local user.email ${{ secrets.GIT_USER_EMAIL }} | |
| git config --local user.name "Turtle-Hwan" | |
| # 현재 버전 읽기 | |
| VERSION=$(node -p "require('./public/manifest.json').version") | |
| # 변경사항 커밋 및 푸시 | |
| git add public/manifest.json | |
| git commit -m "chore: bump version to ${VERSION} [skip ci]" | |
| git push |