From 18880cc6bf41ac4507fcbfbad4842929e190a1eb Mon Sep 17 00:00:00 2001 From: hjoncour Date: Sun, 15 Mar 2026 15:08:42 -0400 Subject: [PATCH] fix(release): cvicd update --- .github/workflows/deploy-cws.yaml | 62 +++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 23 +++++------- TODO.MD | 0 package-lock.json | 4 +- package.json | 2 +- ssmver.toml | 2 +- 6 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/deploy-cws.yaml create mode 100644 TODO.MD diff --git a/.github/workflows/deploy-cws.yaml b/.github/workflows/deploy-cws.yaml new file mode 100644 index 0000000..989a8c3 --- /dev/null +++ b/.github/workflows/deploy-cws.yaml @@ -0,0 +1,62 @@ +name: Deploy to Chrome Web Store + +on: + workflow_dispatch: + inputs: + publish-target: + description: "Publish target" + required: true + type: choice + options: + - trustedTesters + - default + default: trustedTesters + +permissions: + contents: read + +env: + NODE_VERSION: "20" + ARTIFACT_PREFIX: "github-icons" + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - 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) + run: npx wxt zip + + - name: Rename artifact + run: | + cd output + mv *-chrome.zip "${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-chrome.zip" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-chrome + path: output/${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-chrome.zip + + - name: Publish to Chrome Web Store + 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.publish-target }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ee02e8e..c62c961 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,7 @@ permissions: env: NODE_VERSION: "20" + ARTIFACT_PREFIX: "github-icons" jobs: release: @@ -49,26 +50,20 @@ jobs: run: | npx wxt build -b safari SAFARI_DIR=$(ls -d output/safari-* 2>/dev/null | head -1) - cd "$SAFARI_DIR" && zip -qr "../github-material-icons-${{ steps.version.outputs.version }}-safari.zip" . + cd "$SAFARI_DIR" && zip -qr "../${{ env.ARTIFACT_PREFIX }}-${{ steps.version.outputs.version }}-safari.zip" . - name: Rename artifacts for clarity run: | cd output - mv *-chrome.zip "github-material-icons-${{ steps.version.outputs.version }}-chrome.zip" 2>/dev/null || true - mv *-firefox.zip "github-material-icons-${{ steps.version.outputs.version }}-firefox.zip" 2>/dev/null || true + 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: Compute release metadata id: meta run: | VERSION="${{ steps.version.outputs.version }}" - PR="${{ github.event.pull_request.number }}" - if [ -n "$PR" ]; then - echo "tag=v${VERSION}-pr${PR}" >> $GITHUB_OUTPUT - echo "name=Auto release for PR #${PR}" >> $GITHUB_OUTPUT - else - echo "tag=v${VERSION}-run${{ github.run_number }}" >> $GITHUB_OUTPUT - echo "name=Release v${VERSION}" >> $GITHUB_OUTPUT - fi + echo "tag=v${VERSION}" >> $GITHUB_OUTPUT + echo "name=Release - ${VERSION}" >> $GITHUB_OUTPUT - name: Create GitHub release uses: softprops/action-gh-release@v2 @@ -82,9 +77,9 @@ jobs: uses: browser-actions/release-chrome-extension@v0 continue-on-error: true with: - extension-id: ${{ vars.CWS_EXTENSION_ID }} - extension-path: output/github-material-icons-${{ steps.version.outputs.version }}-chrome.zip - oauth-client-id: ${{ vars.CWS_CLIENT_ID }} + 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: default diff --git a/TODO.MD b/TODO.MD new file mode 100644 index 0000000..e69de29 diff --git a/package-lock.json b/package-lock.json index af7ce82..ead00f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chrome-github-icons", - "version": "0.4.1", + "version": "0.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chrome-github-icons", - "version": "0.4.1", + "version": "0.4.2", "hasInstallScript": true, "dependencies": { "@iconify-json/vscode-icons": "^1.2.45", diff --git a/package.json b/package.json index 8a8dc91..1b95a30 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.4.1", + "version": "0.4.2", "type": "module", "scripts": { "sync:assets": "tsx scripts/copy-icons.ts", diff --git a/ssmver.toml b/ssmver.toml index bdc18bf..cf72c38 100644 --- a/ssmver.toml +++ b/ssmver.toml @@ -1,4 +1,4 @@ -version = "0.4.1" +version = "0.4.2" [settings] mode = "branch"