Skip to content

Commit

Permalink
feat: Add action.yml to submit Chrome Extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryohidaka committed Apr 18, 2024
1 parent 8a43840 commit 166ee23
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "WXT Submit"
author: "ryohidaka <39184410+ryohidaka@users.noreply.github.com>"
description: "A GitHub Action that submits new versions of an extension created with WXT for review."
inputs:
dry-run:
description: "Dry Run Flag"
required: false
default: false
chrome-extension-id:
description: "Chrome Extension ID"
required: true
chrome-client-id:
description: "Chrome Client ID"
required: true
chrome-client-secret:
description: "Chrome Client Secret"
required: true
chrome-refresh-token:
description: "Chrome Refresh Token"
required: true

runs:
using: "composite"
steps:
- name: Check if Dryrun is enabled
run: |
if [ "${{ inputs.dry-run }}" == 'true' ]; then
echo "Dryrun mode is enabled"
else
echo "Dryrun mode is disabled"
fi
shell: bash

- name: Check required inputs
run: |
if [[ -z "${{ inputs.chrome-extension-id }}" || -z "${{ inputs.chrome-client-id }}" || -z "${{ inputs.chrome-client-secret }}" || -z "${{ inputs.chrome-refresh-token }}" ]]; then
echo "Error: All required inputs must be provided."
exit 1
fi
shell: bash

- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: "latest"

- uses: actions/setup-node@v4
with:
node-version: latest
cache: "pnpm"

- name: Install dependencies
run: pnpm install
shell: bash

- name: Zip extensions
run: pnpm zip
shell: bash

- name: Submit to stores
run: pnpm wxt submit ${{ inputs.dry-run == 'true' && '--dry-run' || '' }} --chrome-zip .output/*-chrome.zip
shell: bash
env:
CHROME_EXTENSION_ID: ${{ inputs.chrome-extension-id }}
CHROME_CLIENT_ID: ${{ inputs.chrome-client-id }}
CHROME_CLIENT_SECRET: ${{ inputs.chrome-client-secret }}
CHROME_REFRESH_TOKEN: ${{ inputs.chrome-refresh-token }}

0 comments on commit 166ee23

Please sign in to comment.