diff --git a/.github/actions/upload-chrome/action.yaml b/.github/actions/upload-chrome/action.yaml new file mode 100644 index 000000000..ddcc2a74b --- /dev/null +++ b/.github/actions/upload-chrome/action.yaml @@ -0,0 +1,40 @@ +name: Upload to Chrome Web Store +description: Upload extension zip from dist/ directory to Chrome Web Store + +inputs: + CHROME_EXT_ID: + description: Chrome Web Store extension ID + required: true + CHROME_CLIENT_ID: + description: Client ID for Chrome Web Store + required: true + CHROME_CLIENT_SECRET: + description: Client secret for Chrome Web Store + required: true + CHROME_REFRESH_TOKEN: + description: Refresh token for Chrome Web Store + required: true + +runs: + using: composite + + steps: + - name: Setup Node + uses: actions/setup-node@v4 + with: { node-version-file: .nvmrc } + + - name: Get extension path + id: path + shell: bash + run: | + CHROME_ZIP=$(find dist -type f -name "*chrome*.zip") + echo "CHROME_ZIP=$CHROME_ZIP" >> $GITHUB_OUTPUT + + - name: Upload to Chrome Web Store + run: npx chrome-webstore-upload-cli@3 upload --source ${{ steps.path.outputs.chrome }} + shell: bash + env: + EXTENSION_ID: ${{ inputs.CHROME_EXT_ID }} + CLIENT_ID: ${{ inputs.CHROME_CLIENT_ID }} + CLIENT_SECRET: ${{ inputs.CHROME_CLIENT_SECRET }} + REFRESH_TOKEN: ${{ inputs.CHROME_REFRESH_TOKEN }} diff --git a/.github/actions/upload-firefox/action.yaml b/.github/actions/upload-firefox/action.yaml new file mode 100644 index 000000000..596e9a40f --- /dev/null +++ b/.github/actions/upload-firefox/action.yaml @@ -0,0 +1,38 @@ +name: Upload to Firefox Addons +description: Upload extension zip from dist/ directory to Firefox Addons + +inputs: + FIREFOX_API_KEY: + description: API key for Firefox Addons + required: true + FIREFOX_API_SECRET: + description: API secret for Firefox Addons + required: true + +runs: + using: composite + + steps: + - name: Setup Node + uses: actions/setup-node@v4 + with: { node-version-file: .nvmrc } + + - name: Get extension path + id: path + shell: bash + run: | + FIREFOX_ZIP=$(find dist -type f -name "*firefox*.zip") + echo "FIREFOX_ZIP=$FIREFOX_ZIP" >> $GITHUB_OUTPUT + + - name: Get source code + shell: bash + run: git archive --output source.zip HEAD + + # TODO: figure out how to specify build zip file + - name: Upload to Firefox Addons + run: npx web-ext@8 sign --channel listed --upload-source-code ./source.zip + shell: bash + working-directory: artifact + env: + WEB_EXT_API_KEY: ${{ inputs.FIREFOX_API_KEY }} + WEB_EXT_API_SECRET: ${{ inputs.FIREFOX_API_SECRET }}