@@ -106,7 +106,7 @@ jobs:
106106
107107 # Firefox Beta
108108 - name : Create Firefox Beta artifacts
109- run : npm run build:firefox -- --env stream=beta
109+ run : npm run build:firefox -- --env stream=beta --env autoupdate
110110 - uses : actions/upload-artifact@v4
111111 with :
112112 name : FirefoxExtensionBeta
@@ -120,10 +120,8 @@ jobs:
120120 env :
121121 WEB_EXT_API_KEY : ${{ secrets.WEB_EXT_API_KEY }}
122122 WEB_EXT_API_SECRET : ${{ secrets.WEB_EXT_API_SECRET }}
123- - name : Install rename
124- run : sudo apt-get install rename
125123 - name : Rename signed file
126- run : cd ./web-ext-artifacts ; rename 's/.*/ FirefoxSignedInstaller.xpi/' *
124+ run : mv ./web-ext-artifacts/* ./web-ext-artifacts/ FirefoxSignedInstaller.xpi
127125 - uses : actions/upload-artifact@v4
128126 with :
129127 name : FirefoxExtensionSigned.xpi
@@ -137,3 +135,60 @@ jobs:
137135 path : ./web-ext-artifacts/FirefoxSignedInstaller.xpi
138136 repo-token : ${{ secrets.GITHUB_TOKEN }}
139137
138+ - name : Prepare new github pages deployment
139+ shell : python
140+ run : |
141+ from pathlib import Path
142+ import json
143+ import os
144+
145+ # config stuff
146+ installer_name = "FirefoxSignedInstaller.xpi"
147+ owner, repo_name = os.environ["GITHUB_REPOSITORY"].split("/")
148+ owner = owner.lower()
149+
150+ # create the github paged dir
151+ ghp_dir = Path("./github-pages")
152+ ghp_dir.mkdir(parents=True, exist_ok=True)
153+
154+ # move in the installer
155+ Path("./web-ext-artifacts", installer_name).rename(ghp_dir / installer_name)
156+
157+ # read manifest.json and extract parameters
158+ with open("./dist/manifest.json") as f:
159+ manifest = json.load(f)
160+ current_version = manifest["version"]
161+ ext_id = manifest["browser_specific_settings"]["gecko"]["id"]
162+
163+ # generate updates file
164+ updates = {
165+ "addons": {
166+ ext_id: {
167+ "updates": [
168+ {
169+ "version": current_version,
170+ # param doesn't actually matter, it's just a cachebuster
171+ "update_link": f"https://{owner}.github.io/{repo_name}/{installer_name}?v={current_version}",
172+ },
173+ ],
174+ },
175+ },
176+ }
177+ (ghp_dir / "updates.json").write_text(json.dumps(updates))
178+
179+ - name : Upload new github pages deployment
180+ uses : actions/upload-pages-artifact@v3
181+ with :
182+ path : ./github-pages
183+
184+ deploy-ghp :
185+ name : Deploy to github pages
186+ needs : build
187+ environment :
188+ name : github-pages
189+ url : ${{ steps.deployment.outputs.page_url }}
190+ runs-on : ubuntu-latest
191+ steps :
192+ - name : Deploy
193+ id : deployment
194+ uses : actions/deploy-pages@v4
0 commit comments