From c96077879c98b49c0f59f38cf7ae920c82b741dc Mon Sep 17 00:00:00 2001 From: hjoncour Date: Mon, 23 Mar 2026 20:36:34 -0400 Subject: [PATCH] fix(deploy): add gha to manually redeploy --- .github/workflows/deploy.yaml | 94 +++++++++++++++++++++++++++++++++++ package-lock.json | 4 +- package.json | 2 +- ssmver.toml | 2 +- 4 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..9e3150c --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,94 @@ +name: Deploy + +on: + workflow_dispatch: + inputs: + target: + description: "Deploy target" + required: true + type: choice + options: + - chrome + - firefox + - both + ref: + description: "Branch, tag, or commit SHA to deploy" + required: false + default: "" + chrome-publish-target: + description: "Chrome publish target (ignored for Firefox)" + required: false + type: choice + options: + - default + - trustedTesters + default: default + +permissions: + contents: read + +env: + NODE_VERSION: "20" + ARTIFACT_PREFIX: "github-icons" + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Extract version + id: version + run: echo "version=$(node -p 'require("./package.json").version')" >> $GITHUB_OUTPUT + + - name: Build & zip (Chrome) + if: inputs.target == 'chrome' || inputs.target == 'both' + run: npx wxt zip + + - name: Build & zip (Firefox) + if: inputs.target == 'firefox' || inputs.target == 'both' + run: npx wxt zip -b firefox + + - name: Rename artifacts + run: | + cd output + mv *-chrome.zip "${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-chrome.zip" 2>/dev/null || true + mv *-firefox.zip "${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-firefox.zip" 2>/dev/null || true + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }} + path: output/*.zip + + - name: Publish to Chrome Web Store + if: inputs.target == 'chrome' || inputs.target == 'both' + uses: browser-actions/release-chrome-extension@v0 + with: + extension-id: ${{ secrets.CWS_EXTENSION_ID }} + extension-path: output/${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-chrome.zip + oauth-client-id: ${{ secrets.CWS_CLIENT_ID }} + oauth-client-secret: ${{ secrets.CWS_CLIENT_SECRET }} + oauth-refresh-token: ${{ secrets.CWS_REFRESH_TOKEN }} + publish-target: ${{ inputs.chrome-publish-target }} + + - name: Publish to Firefox Add-ons + if: inputs.target == 'firefox' || inputs.target == 'both' + run: | + echo '{"version": {"license": "MIT"}}' > amo-metadata.json + npx web-ext sign \ + --channel=listed \ + --source-dir=output/firefox-mv2 \ + --api-key=${{ secrets.AMO_JWT_ISSUER }} \ + --api-secret=${{ secrets.AMO_JWT_SECRET }} \ + --amo-metadata=amo-metadata.json diff --git a/package-lock.json b/package-lock.json index 577f93c..eeb0ced 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chrome-github-icons", - "version": "0.7.0", + "version": "0.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chrome-github-icons", - "version": "0.7.0", + "version": "0.7.1", "hasInstallScript": true, "dependencies": { "@iconify-json/vscode-icons": "^1.2.45", diff --git a/package.json b/package.json index 13a5e31..8ee7250 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "chrome-github-icons", "description": "Cross-browser extension that replaces GitHub file icons with Material Design icons.", "private": true, - "version": "0.7.0", + "version": "0.7.1", "type": "module", "scripts": { "sync:assets": "tsx scripts/copy-icons.ts", diff --git a/ssmver.toml b/ssmver.toml index d709017..8c46f26 100644 --- a/ssmver.toml +++ b/ssmver.toml @@ -1,4 +1,4 @@ -version = "0.7.0" +version = "0.7.1" [settings] mode = "branch"