Skip to content

Commit bb0279c

Browse files
committed
ci: add unsigned Firefox XPI job, fix master->main, include XPI in release
1 parent 215d093 commit bb0279c

1 file changed

Lines changed: 39 additions & 10 deletions

File tree

.github/workflows/build.yaml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,35 @@ jobs:
4444
name: Chrome Extension (Unsigned)
4545
path: extension.zip
4646

47+
build_firefox:
48+
name: "Build Firefox Extension (Unsigned XPI)"
49+
runs-on: ubuntu-24.04
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
56+
- uses: ./.github/actions/setup-for-build
57+
58+
- name: Build
59+
run: pnpm build
60+
env:
61+
SZ_GECKO_ID: 13372607-2257-4360-8f51-5ce66fa73350
62+
63+
- name: Pack XPI (unsigned)
64+
run: pnpm pack:xpi
65+
66+
- uses: actions/upload-artifact@v4
67+
with:
68+
name: Firefox Extension (Unsigned XPI)
69+
path: extension.xpi
70+
4771
build_unlisted_firefox:
48-
name: "Build Unlisted Firefox Extension"
72+
name: "Build Unlisted Firefox Extension (Signed)"
4973
runs-on: ubuntu-24.04
50-
# Doesn't really need the Chrome build, but we can reuse its cache.
51-
needs: build_chrome
52-
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
74+
needs: build_firefox
75+
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && secrets.WEB_EXT_API_KEY != ''
5376
steps:
5477
- name: Checkout
5578
uses: actions/checkout@v4
@@ -80,10 +103,8 @@ jobs:
80103
build_amo_firefox:
81104
name: "Build Firefox Extension for AMO"
82105
runs-on: ubuntu-24.04
83-
# Doesn't really need the Chrome build, but we can reuse its cache.
84-
needs: build_chrome
85-
# Only run (on master branch && if tagged) or (manually dispatching).
86-
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish_amo_listed == true
106+
needs: build_firefox
107+
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish_amo_listed == 'true'
87108
steps:
88109
- name: Checkout
89110
uses: actions/checkout@v4
@@ -106,7 +127,7 @@ jobs:
106127
create_release:
107128
name: "Create GitHub Release"
108129
runs-on: ubuntu-24.04
109-
needs: build_chrome
130+
needs: [build_chrome, build_firefox]
110131
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.create_release == 'true'
111132
permissions:
112133
contents: write
@@ -117,6 +138,12 @@ jobs:
117138
name: Chrome Extension (Unsigned)
118139
path: artifacts/
119140

141+
- name: Download Firefox artifact
142+
uses: actions/download-artifact@v4
143+
with:
144+
name: Firefox Extension (Unsigned XPI)
145+
path: artifacts/
146+
120147
- name: Get version from tag
121148
id: version
122149
run: echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
@@ -127,4 +154,6 @@ jobs:
127154
tag_name: ${{ steps.version.outputs.tag }}
128155
name: "SzuruChrome Reworked ${{ steps.version.outputs.tag }}"
129156
generate_release_notes: true
130-
files: artifacts/extension.zip
157+
files: |
158+
artifacts/extension.zip
159+
artifacts/extension.xpi

0 commit comments

Comments
 (0)