From 3aff8dc4d91bdaf9174b06e7ab4507dd9f43d5a2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 8 Aug 2026 17:50:51 +0200 Subject: [PATCH] ci: add release workflow --- .forgejo/workflows/release.yml | 42 ++++++++++++++++++++++++++++++++++ manifest.json | 3 ++- updates.json | 12 ++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/release.yml create mode 100644 updates.json diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..8e59280 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,42 @@ +name: Build and Sign Extension + +on: + push: + tags: + - 'v*' + +jobs: + build-sign-release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Mozilla web-ext CLI + run: npm install -g web-ext + + - name: Build and Sign with Mozilla + id: sign_extension + # web-ext will automatically zip the directory, upload it to Mozilla, + # wait for the cryptographic signature, and download the resulting .xpi + run: | + web-ext sign \ + --source-dir . \ + --channel unlisted \ + --api-key ${{ secrets.AMO_JWT_ISSUER }} \ + --api-secret ${{ secrets.AMO_JWT_SECRET }} \ + --artifacts-dir ./web-ext-artifacts \ + --ignore-files ".forgejo" ".git" "updates.json" "*.md" + + - name: Upload signed XPI to Forgejo Release + uses: softprops/action-gh-release@v2 + with: + # web-ext puts the downloaded file in the artifacts directory + files: ./web-ext-artifacts/*.xpi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/manifest.json b/manifest.json index dcca74c..11922e6 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,8 @@ }, "browser_specific_settings": { "gecko": { - "id": "print-picker@yourdomain.com" + "id": "print-element-picker@git.depeuter.dev", + "update_url": "https://git.depeuter.dev/tdpeuter/tdpeuter/print-element-picker/raw/branch/main/updates.json" } } } diff --git a/updates.json b/updates.json new file mode 100644 index 0000000..458b2ad --- /dev/null +++ b/updates.json @@ -0,0 +1,12 @@ +{ + "addons": { + "print-element-picker@git.depeuter.dev": { + "updates": [ + { + "version": "0.1", + "update_link": "https://git.depeuter.dev/tdpeuter/print-element-picker/releases/download/v0.1/print-element-picker-0.1.xpi" + } + ] + } + } +}