From dc1d66763d8d57c3ea41fac64c27dd0471eadcfb Mon Sep 17 00:00:00 2001 From: haopengzhan Date: Sun, 23 Aug 2026 15:24:55 -0700 Subject: [PATCH] fix(ci): add contents:write permission and tag trigger to release workflow --- .github/workflows/release.yml | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b734ccf..133a17a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,14 @@ name: Build & Package Extension Release on: release: types: [published] + push: + tags: + - 'v*' workflow_dispatch: +permissions: + contents: write + jobs: build-release: name: Build ZIP & Attach to GitHub Release @@ -14,6 +20,11 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + - name: Read Extension Version id: version run: | @@ -43,30 +54,8 @@ jobs: unzip -l "$ZIP_NAME" - name: Upload ZIP to GitHub Release Assets - if: github.event_name == 'release' uses: softprops/action-gh-release@v2 with: files: ${{ env.ZIP_FILE }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ------------------------------------------------------------------------ - # TODO: Auto-Publish to Chrome Web Store - # ------------------------------------------------------------------------ - # Once you create the initial extension item in the Chrome Web Store Developer - # Dashboard and generate Google Cloud OAuth credentials, uncomment this step - # and configure the following 4 secrets in GitHub (Settings > Secrets > Actions): - # - CHROME_EXTENSION_ID - # - CHROME_CLIENT_ID - # - CHROME_CLIENT_SECRET - # - CHROME_REFRESH_TOKEN - # ------------------------------------------------------------------------ - # - name: Upload & Publish to Chrome Web Store - # uses: fregante/chrome-web-store-upload-action@v2 - # with: - # file-name: ${{ env.ZIP_FILE }} - # extension-id: ${{ secrets.CHROME_EXTENSION_ID }} - # client-id: ${{ secrets.CHROME_CLIENT_ID }} - # client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} - # refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} - # publish: true