Skip to content

Commit

Permalink
feat: Add root-path option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryohidaka committed Sep 7, 2024
1 parent df3b576 commit 33c188f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
13 changes: 9 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
description: "Dry Run Flag"
required: false
default: false
root-path:
description: "The root path of the wxt project. Default is the current directory."
required: false
default: "."

# Inputs for Chrome Extension
chrome:
Expand Down Expand Up @@ -79,14 +83,15 @@ runs:
with:
node-version: latest
cache: "pnpm"
cache-dependency-path: ${{ inputs.root-path }}

- name: Install dependencies
run: scripts/install_dependencies.sh
run: scripts/install_dependencies.sh "${{ inputs.root-path }}"
shell: bash

- name: Submit to Chrome
if: ${{ inputs.chrome == 'true' }}
run: scripts/submit_to_chrome.sh "${{ inputs.dry-run }}"
run: scripts/submit_to_chrome.sh "${{ inputs.root-path }}" "${{ inputs.dry-run }}"
shell: bash
env:
CHROME_EXTENSION_ID: ${{ inputs.chrome-extension-id }}
Expand All @@ -96,7 +101,7 @@ runs:

- name: Submit to Firefox
if: ${{ inputs.firefox == 'true' }}
run: scripts/submit_to_firefox.sh "${{ inputs.dry-run }}"
run: scripts/submit_to_firefox.sh "${{ inputs.root-path }}" "${{ inputs.dry-run }}"
shell: bash
env:
FIREFOX_EXTENSION_ID: ${{ inputs.firefox-extension-id }}
Expand All @@ -105,7 +110,7 @@ runs:

- name: Submit to Edge
if: ${{ inputs.edge == 'true' }}
run: scripts/submit_to_edge.sh "${{ inputs.dry-run }}"
run: scripts/submit_to_edge.sh "${{ inputs.root-path }}" "${{ inputs.dry-run }}"
shell: bash
env:
EDGE_PRODUCT_ID: ${{ inputs.edge-product-id }}
Expand Down
1 change: 1 addition & 0 deletions scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

echo "::group::Install dependencies"
cd "$1" || exit 1
pnpm install
echo "::endgroup::"
3 changes: 2 additions & 1 deletion scripts/submit_to_chrome.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

echo "::group::Submit to Chrome"
cd "$1" || exit 1
pnpm zip
pnpm wxt submit \
$([ "$1" == 'true' ] && echo "--dry-run") \
$([ "$2" == 'true' ] && echo "--dry-run") \
--chrome-zip .output/*-chrome.zip
echo "::endgroup::"
3 changes: 2 additions & 1 deletion scripts/submit_to_edge.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

echo "::group::Submit to Edge"
cd "$1" || exit 1
pnpm zip
pnpm wxt submit \
$([ "$1" == 'true' ] && echo "--dry-run") \
$([ "$2" == 'true' ] && echo "--dry-run") \
--edge-zip .output/*-chrome.zip
echo "::endgroup::"
3 changes: 2 additions & 1 deletion scripts/submit_to_firefox.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

echo "::group::Submit to Firefox"
cd "$1" || exit 1
pnpm zip:firefox
pnpm wxt submit \
$([ "$1" == 'true' ] && echo "--dry-run") \
$([ "$2" == 'true' ] && echo "--dry-run") \
--firefox-zip .output/*-firefox.zip --firefox-sources-zip .output/*-sources.zip
echo "::endgroup::"

0 comments on commit 33c188f

Please sign in to comment.