|
| 1 | +name: Build release |
| 2 | +on: |
| 3 | + push: |
| 4 | + paths: |
| 5 | + - src/** |
| 6 | + - extension/** |
| 7 | + - package.json |
| 8 | + - pnpm-lock.yaml |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + publish_amo_listed: |
| 12 | + description: "Publish to AMO" |
| 13 | + required: false |
| 14 | + type: boolean |
| 15 | +jobs: |
| 16 | + build_chrome: |
| 17 | + name: "Build Chrome Extension" |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v2 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - uses: ./.github/actions/setup-for-build |
| 26 | + |
| 27 | + - name: Build |
| 28 | + run: pnpm build |
| 29 | + |
| 30 | + - name: Pack ZIP |
| 31 | + run: pnpm pack:zip |
| 32 | + |
| 33 | + - uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: Chrome Extension (Unsigned) |
| 36 | + path: extension.zip |
| 37 | + |
| 38 | + build_unlisted_firefox: |
| 39 | + name: "Build Unlisted Firefox Extension" |
| 40 | + runs-on: ubuntu-24.04 |
| 41 | + # Doesn't really need the Chrome build, but we can reuse its cache. |
| 42 | + needs: build_chrome |
| 43 | + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v2 |
| 47 | + with: |
| 48 | + fetch-depth: 0 |
| 49 | + |
| 50 | + - uses: ./.github/actions/setup-for-build |
| 51 | + |
| 52 | + - name: Build |
| 53 | + run: pnpm build |
| 54 | + env: |
| 55 | + SZ_GECKO_ID: 13372607-2257-4360-8f51-5ce66fa73350 |
| 56 | + |
| 57 | + - name: Sign XPI |
| 58 | + run: pnpm sign:firefox --channel unlisted |
| 59 | + env: |
| 60 | + WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} |
| 61 | + WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} |
| 62 | + |
| 63 | + - name: Rename XPI |
| 64 | + run: rename.ul szuruchrome_gh- SzuruChrome-v web-ext-artifacts/*.xpi |
| 65 | + |
| 66 | + - uses: actions/upload-artifact@v4 |
| 67 | + with: |
| 68 | + name: Firefox Extension (Signed) |
| 69 | + path: web-ext-artifacts/*.xpi |
| 70 | + |
| 71 | + build_amo_firefox: |
| 72 | + name: "Build Firefox Extension for AMO" |
| 73 | + runs-on: ubuntu-24.04 |
| 74 | + # Doesn't really need the Chrome build, but we can reuse its cache. |
| 75 | + needs: build_chrome |
| 76 | + # Only run (on master branch && if tagged) or (manually dispatching). |
| 77 | + if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish_amo_listed == true |
| 78 | + steps: |
| 79 | + - name: Checkout |
| 80 | + uses: actions/checkout@v2 |
| 81 | + with: |
| 82 | + fetch-depth: 0 |
| 83 | + |
| 84 | + - uses: ./.github/actions/setup-for-build |
| 85 | + |
| 86 | + - name: Build |
| 87 | + run: pnpm build |
| 88 | + env: |
| 89 | + SZ_GECKO_ID: 18365332-8485-4c04-9498-2843a41ab620 |
| 90 | + |
| 91 | + - name: Sign XPI and upload to AMO |
| 92 | + run: pnpm sign:firefox --channel listed |
| 93 | + env: |
| 94 | + WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} |
| 95 | + WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} |
0 commit comments