v1.0.2-ext 배포 (#10) #3
Workflow file for this run
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: Release Extension | |
| concurrency: | |
| group: ext-release | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| tags: | |
| - 'v*-ext' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate tag is on prod branch | |
| run: | | |
| git fetch origin prod | |
| if git merge-base --is-ancestor ${{ github.sha }} origin/prod; then | |
| echo "이 태그는 prod branch에 포함되어 있습니다. 릴리즈를 진행합니다." | |
| else | |
| echo "Error: 이 tag는 prod branch에 없습니다." | |
| exit 1 | |
| fi | |
| - name: Validate version match | |
| run: | | |
| TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//' | sed 's/-ext$//') | |
| MANIFEST_VERSION=$(node -p "require('./public/manifest.json').version") | |
| echo "Tag version: $TAG_VERSION" | |
| echo "Manifest version: $MANIFEST_VERSION" | |
| if [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then | |
| echo "Error: 태그 버전($TAG_VERSION)과 manifest.json 버전($MANIFEST_VERSION)이 일치하지 않습니다." | |
| exit 1 | |
| fi | |
| echo "버전이 일치합니다." | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm run test:run | |
| - name: Build extension | |
| run: npm run build | |
| env: | |
| VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }} | |
| - name: Create ZIP file | |
| run: | | |
| cd dist | |
| zip -r ../recycle-study-extension-${{ github.ref_name }}.zip . | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: recycle-study-extension-${{ github.ref_name }}.zip | |
| generate_release_notes: true | |
| draft: true |