Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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
34 changes: 34 additions & 0 deletions .github/workflows/test-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test & Build Validation

on:
pull_request:
branches:
- dev
- prod
push:
branches:
- dev
- prod

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- 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
run: npm run build
Loading