diff --git a/.github/workflows/publish-firefox.yml b/.github/workflows/publish-firefox.yml new file mode 100644 index 0000000..cde378c --- /dev/null +++ b/.github/workflows/publish-firefox.yml @@ -0,0 +1,32 @@ +name: Publish Firefox Addon + +on: + push: + tags: + - '*' + +jobs: + publish-firefox-extension: + runs-on: ubuntu-latest + outputs: + xpi_filepath: ${{ steps.sign.outputs.xpi_filepath }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: 'npm' + - name: Install npm modules + run: npm ci + - name: Build + run: | + npm run build-firefox + - name: Publish + env: + WEB_EXT_API_KEY: ${{ vars.FIREFOX_API_KEY }} + WEB_EXT_API_SECRET: ${{ secrets.FIREFOX_API_SECRET }} + # https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#use-submission-api + run: npx web-ext sign --use-submission-api --channel=listed --source-dir=./dist/firefox diff --git a/.gitignore b/.gitignore index e1a8624..64aa27a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ xcuserdata/ **/xcshareddata/WorkspaceSettings.xcsettings native-messaging-host/build/ + +# Artifacts from signing the addon for Firefox +web-ext-artifacts diff --git a/manifest.firefox.json b/manifest.firefox.json index 79999c9..2729175 100644 --- a/manifest.firefox.json +++ b/manifest.firefox.json @@ -1,7 +1,7 @@ { "browser_specific_settings": { "gecko": { - "id": "keeweb-connect@keeweb.info" + "id": "keeweb-connect-addon@keeweb.info" } }, "commands": { diff --git a/package.json b/package.json index 18aa758..e534704 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "eslint": "eslint webpack.config.ts src scripts", "prettier": "prettier --write src/**/*.ts src/**/*.tsx pages/*.html styles/*.css", "download-translations": "ts-node scripts/download-translations", - "bump-version": "ts-node scripts/bump-version" + "bump-version": "ts-node scripts/bump-version", + "publish-firefox-addon": "node .github/publish-firefox-addon.js" }, "repository": { "type": "git",