feat(release): upload stable latest XPI alias during release:push
- Publish archive-org-link-grabber-latest.xpi alongside versioned artifacts - Document behavior in README
This commit is contained in:
parent
fb7e208252
commit
bc28130855
2 changed files with 20 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ This project is not affiliated with archive.org or aria2. Use responsibly and re
|
||||||
- Set environment secrets locally (do not commit): `AMO_JWT_ISSUER=... AMO_JWT_SECRET=...`
|
- Set environment secrets locally (do not commit): `AMO_JWT_ISSUER=... AMO_JWT_SECRET=...`
|
||||||
- Run: `npm run release:sign`
|
- Run: `npm run release:sign`
|
||||||
- Artifacts land in `releases/<version>/`
|
- Artifacts land in `releases/<version>/`
|
||||||
- Push (self-hosted): `npm run release:push` uploads the signed artifacts in `releases/<version>/` and prepares/uploads `releases/updates.json` automatically (deriving the `update_link` from the manifest’s `applications.gecko.update_url`).
|
- Push (self-hosted): `npm run release:push` uploads the signed artifacts in `releases/<version>/` and prepares/uploads `releases/updates.json` automatically (deriving the `update_link` from the manifest’s `applications.gecko.update_url`). It also uploads a stable alias `archive-org-link-grabber-latest.xpi` that always points to the most recent XPI.
|
||||||
- Ensure FTP env vars are set (see `.env.example`).
|
- Ensure FTP env vars are set (see `.env.example`).
|
||||||
|
|
||||||
Notes: Keep AMO secrets local (see `.env.example`). CI is optional. You can tag releases with `git tag vX.Y.Z` and push tags if desired.
|
Notes: Keep AMO secrets local (see `.env.example`). CI is optional. You can tag releases with `git tag vX.Y.Z` and push tags if desired.
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,25 @@ for (const file of files) {
|
||||||
run(cmd, [user, pass]);
|
run(cmd, [user, pass]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Upload a copy of the latest XPI under a stable filename for static linking
|
||||||
|
try {
|
||||||
|
const latestAlias = 'archive-org-link-grabber-latest.xpi';
|
||||||
|
const localLatestSrc = path.join(artifactsDir, chosenXpi);
|
||||||
|
const latestUrl = `${baseUrl}/${latestAlias}`;
|
||||||
|
console.log(`Uploading latest alias ${latestAlias} -> ${chosenXpi}`);
|
||||||
|
const latestCmd = [
|
||||||
|
'curl',
|
||||||
|
'--fail',
|
||||||
|
'--ftp-create-dirs',
|
||||||
|
`--user`, `${user}:${pass}`,
|
||||||
|
'--upload-file', JSON.stringify(localLatestSrc),
|
||||||
|
JSON.stringify(latestUrl),
|
||||||
|
].join(' ');
|
||||||
|
run(latestCmd, [user, pass]);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Warning: Failed to upload latest alias:', e.message);
|
||||||
|
}
|
||||||
|
|
||||||
// Also upload updates.json (self-hosted updates manifest) alongside artifacts
|
// Also upload updates.json (self-hosted updates manifest) alongside artifacts
|
||||||
const updatesPath = path.join(root, 'releases', 'updates.json');
|
const updatesPath = path.join(root, 'releases', 'updates.json');
|
||||||
if (fs.existsSync(updatesPath)) {
|
if (fs.existsSync(updatesPath)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue