From 1f6b9e7768ef2489fcfce69fe09fc9b96e7acd7b Mon Sep 17 00:00:00 2001 From: ryota iso Date: Tue, 7 Apr 2026 23:31:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Chrome=E6=8B=A1=E5=BC=B5=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=81=AE=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E7=94=A8?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 86 +++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 185ec6b..1ffe6fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI on: + workflow_call: push: branches: - main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b070d18 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,86 @@ +name: Release Chrome Extension + +on: + release: + types: + - published + +permissions: + contents: read + +concurrency: + group: release-${{ github.workflow }}-${{ github.event.release.tag_name }} + cancel-in-progress: true + +jobs: + quality: + uses: ./.github/workflows/ci.yml + permissions: + contents: read + + build-chrome: + name: Build Chrome + runs-on: ubuntu-24.04 + timeout-minutes: 10 + needs: + - quality + permissions: + contents: read + env: + ASSET_NAME: header-injector-chrome-${{ github.event.release.tag_name }}.zip + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 1 + persist-credentials: false + + - name: Setup Vite+ + uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0 + with: + version: "0.1.14" + node-version: "24.14.1" + cache: true + run-install: true + + - name: Build Chrome extension + run: vp run @header-injector/extension#build:chrome + + - name: Package Chrome extension + working-directory: apps/extension/dist/chrome + env: + ASSET_PATH: ${{ runner.temp }}/${{ env.ASSET_NAME }} + run: zip -r "$ASSET_PATH" . + + - name: Upload packaged artifact + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + env: + ASSET_PATH: ${{ runner.temp }}/${{ env.ASSET_NAME }} + with: + name: chrome-release-asset + path: ${{ env.ASSET_PATH }} + if-no-files-found: error + + upload-release-asset: + name: Upload Release Asset + runs-on: ubuntu-24.04 + timeout-minutes: 10 + needs: + - build-chrome + permissions: + contents: write + env: + ASSET_NAME: header-injector-chrome-${{ github.event.release.tag_name }}.zip + steps: + - name: Download packaged artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: chrome-release-asset + path: ${{ runner.temp }}/release-asset + + - name: Upload release asset + env: + ASSET_PATH: ${{ runner.temp }}/release-asset/${{ env.ASSET_NAME }} + GH_TOKEN: ${{ github.token }} + TAG_NAME: ${{ github.event.release.tag_name }} + run: gh release upload "$TAG_NAME" "$ASSET_PATH" --repo "$GITHUB_REPOSITORY" --clobber