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
62 changes: 62 additions & 0 deletions .github/workflows/deploy-cws.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 9 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:

env:
NODE_VERSION: "20"
ARTIFACT_PREFIX: "github-icons"

jobs:
release:
Expand Down Expand Up @@ -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
Expand All @@ -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
Empty file added TODO.MD
Empty file.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion ssmver.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.4.1"
version = "0.4.2"

[settings]
mode = "branch"
Expand Down
Loading