diff --git a/.github/amo-metadata.json b/.github/amo-metadata.json new file mode 100644 index 0000000..5868c39 --- /dev/null +++ b/.github/amo-metadata.json @@ -0,0 +1,5 @@ +{ + "version": { + "approval_notes": "Build from the submitted source archive with Node.js 22 and npm: run npm ci, then npm run build from the project root. The Firefox extension output is dist/. No credentials or environment variables are required. To test, right-click a link or page and choose Bag It, then use the toolbar popup's Save open tabs action with an existing folder or a new subfolder. Repeat with duplicate prevention enabled; duplicates should be skipped only within the destination folder. Tabs remain open. Bookmark data and settings are stored locally; the extension has no analytics or developer-operated backend." + } +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3ab0dc..dea6812 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ on: channel: description: 'Release Channel (unlisted for direct .xpi download, listed for public store)' required: true - default: 'unlisted' + default: 'listed' type: choice options: - unlisted @@ -29,6 +29,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Node.js uses: actions/setup-node@v4 @@ -67,20 +69,46 @@ jobs: - name: Build Extension run: npm run build + - name: Package Reviewer Source + run: git ls-files | zip -q reviewer-source.zip -@ + + - name: Prepare AMO Release Notes + run: | + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + BASE_TAG=$(git describe --tags --abbrev=0 "${GITHUB_SHA}^" 2>/dev/null || true) + else + BASE_TAG=$(git describe --tags --abbrev=0 "${GITHUB_SHA}" 2>/dev/null || true) + fi + if [ -n "$BASE_TAG" ]; then + git log --no-merges --format='- %s' "$BASE_TAG..$GITHUB_SHA" > release-notes.txt + else + echo "BagMark ${{ steps.versioning.outputs.version }} release." > release-notes.txt + fi + node --input-type=module -e ' + import fs from "node:fs"; + const metadata = JSON.parse(fs.readFileSync(".github/amo-metadata.json", "utf8")); + metadata.version.release_notes = { "en-US": fs.readFileSync("release-notes.txt", "utf8").trim() }; + fs.writeFileSync("amo-metadata.json", JSON.stringify(metadata)); + ' + - name: Sign Extension via Mozilla Add-ons (AMO) id: sign run: | - CHANNEL="${{ github.event.inputs.channel || 'unlisted' }}" + CHANNEL="${{ github.event.inputs.channel || 'listed' }}" echo "Signing channel: $CHANNEL" - npx web-ext sign \ + npx --yes web-ext@10.5.0 sign \ --source-dir dist \ --artifacts-dir signed-artifacts \ --api-key "${{ secrets.AMO_JWT_ISSUER }}" \ --api-secret "${{ secrets.AMO_JWT_SECRET }}" \ + --upload-source-code reviewer-source.zip \ + --amo-metadata amo-metadata.json \ + --approval-timeout 0 \ --channel "$CHANNEL" - name: Upload Signed Artifact to Actions uses: actions/upload-artifact@v4 + if: github.event.inputs.channel == 'unlisted' with: name: bagmark-v${{ steps.versioning.outputs.version }}-signed path: signed-artifacts/* @@ -89,6 +117,7 @@ jobs: uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - files: signed-artifacts/* name: "BagMark v${{ steps.versioning.outputs.version }}" generate_release_notes: true + files: signed-artifacts/* + fail_on_unmatched_files: false diff --git a/README.md b/README.md index 6e711b6..f96da93 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,17 @@ npm run package ``` The resulting zip will be created in `web-ext-artifacts/`. +### Mozilla Reviewer Build Instructions + +The source archive contains the original TypeScript, assets, build configuration, and npm lockfile. On Linux, macOS, or Windows, install Node.js 22 with its bundled npm, extract the archive, and run from its root: + +```bash +npm ci +npm run build +``` + +The Firefox extension is generated in `dist/`. No credentials, environment variables, external services, or private dependencies are needed to reproduce this build. The release workflow uploads the source archive to Mozilla with the extension, for both listed and unlisted submissions. + ### 🚀 Automated Releases & Mozilla AMO Signing This repository is configured with a GitHub Actions workflow that automatically builds, tests, signs with Mozilla AMO, and publishes a GitHub Release when a git tag is pushed: diff --git a/manifest.json b/manifest.json index fad3020..3a96f51 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "BagMark - Advanced Bookmarks", - "version": "1.1.0", + "version": "1.1.1", "description": "Right-click to save bookmarks to custom or date-based folders with rich metadata.", "permissions": [ "bookmarks", diff --git a/package-lock.json b/package-lock.json index 2b1bc40..4bed29e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bag-bookmark", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "bag-bookmark", - "version": "1.1.0", + "version": "1.1.1", "devDependencies": { "@types/firefox-webext-browser": "^143.0.1", "@types/node": "^22.0.0", diff --git a/package.json b/package.json index 0183167..f304a90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bag-bookmark", - "version": "1.1.0", + "version": "1.1.1", "description": "Advanced bookmark extension for Firefox, Chrome, and Brave with date tracking, custom folders, and context menu quick-save", "type": "module", "scripts": {