fix: add background.scripts fallback for Firefox AMO signing #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build release | |
| on: | |
| push: | |
| paths: | |
| - src/** | |
| - extension/** | |
| - package.json | |
| - pnpm-lock.yaml | |
| - .github/** | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| publish_amo_listed: | |
| description: "Publish to AMO" | |
| required: false | |
| type: boolean | |
| create_release: | |
| description: "Create GitHub Release" | |
| required: false | |
| type: boolean | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build_chrome: | |
| name: "Build Chrome Extension" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup-for-build | |
| - name: Build | |
| run: pnpm build | |
| - name: Pack ZIP | |
| run: pnpm pack:zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Chrome Extension (Unsigned) | |
| path: extension.zip | |
| build_firefox: | |
| name: "Build Firefox Extension (Unsigned XPI)" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup-for-build | |
| - name: Build | |
| run: pnpm build | |
| env: | |
| SZ_GECKO_ID: 13372607-2257-4360-8f51-5ce66fa73350 | |
| - name: Pack XPI (unsigned) | |
| run: pnpm pack:xpi | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Firefox Extension (Unsigned XPI) | |
| path: extension.xpi | |
| build_unlisted_firefox: | |
| name: "Build Unlisted Firefox Extension (Signed)" | |
| runs-on: ubuntu-24.04 | |
| needs: build_firefox | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup-for-build | |
| - name: Build | |
| run: pnpm build | |
| env: | |
| SZ_GECKO_ID: 13372607-2257-4360-8f51-5ce66fa73350 | |
| - name: Sign XPI | |
| run: pnpm sign:firefox --channel unlisted | |
| env: | |
| WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} | |
| WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} | |
| - name: Rename XPI | |
| run: rename.ul szuruchrome_gh- SzuruChrome-v web-ext-artifacts/*.xpi | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Firefox Extension (Signed) | |
| path: web-ext-artifacts/*.xpi | |
| build_amo_firefox: | |
| name: "Build Firefox Extension for AMO" | |
| runs-on: ubuntu-24.04 | |
| needs: build_firefox | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish_amo_listed == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup-for-build | |
| - name: Build | |
| run: pnpm build | |
| env: | |
| SZ_GECKO_ID: 18365332-8485-4c04-9498-2843a41ab620 | |
| - name: Sign XPI and upload to AMO | |
| run: pnpm sign:firefox --channel listed | |
| env: | |
| WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} | |
| WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} | |
| create_release: | |
| name: "Create GitHub Release" | |
| runs-on: ubuntu-24.04 | |
| needs: [build_chrome, build_firefox] | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.create_release == 'true' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download Chrome artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Chrome Extension (Unsigned) | |
| path: artifacts/ | |
| - name: Download Firefox artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Firefox Extension (Unsigned XPI) | |
| path: artifacts/ | |
| - name: Get version from tag | |
| id: version | |
| run: echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: "SzuruChrome Reworked ${{ steps.version.outputs.tag }}" | |
| generate_release_notes: true | |
| files: | | |
| artifacts/extension.zip | |
| artifacts/extension.xpi |