From 06251f190b9d04a5ef60480e218a7c5d6ffe9be4 Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Sat, 11 Mar 2023 21:17:55 +0900 Subject: Add CD to build and publish extension to Chrome & Firefox stores Resolves #85. --- .github/workflows/publish-firefox-development.yml | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/publish-firefox-development.yml (limited to '.github/workflows/publish-firefox-development.yml') diff --git a/.github/workflows/publish-firefox-development.yml b/.github/workflows/publish-firefox-development.yml new file mode 100644 index 00000000..5699311f --- /dev/null +++ b/.github/workflows/publish-firefox-development.yml @@ -0,0 +1,86 @@ +# For the Firefox development addon, people install it manually, +# and updates are distributed via the JSON file created in this +# action which is stored in the metadata branch of this repo. + +name: publish-firefox-development +on: + release: + types: [prereleased] +permissions: + contents: write +jobs: + build-signed-xpi-asset: + needs: ensure-zip + runs-on: ubuntu-latest + environment: cd + steps: + - uses: actions/checkout@v3 + + - uses: robinraju/release-downloader@768b85c8d69164800db5fc00337ab917daf3ce68 # pin@v1.7 + with: + release: ${{ github.event.release.id }} + fileName: "*" + + - name: Sign Firefox xpi for offline distribution + id: ffSignXpi + continue-on-error: true + uses: cardinalby/webext-buildtools-firefox-sign-xpi-action@94a2e58141e33c4306a72a93f191e8540189df92 # pin@v1.0.6 + with: + timeoutMs: 1200000 + extensionId: ${{ secrets.FF_OFFLINE_EXT_ID }} + zipFilePath: builds/yomitan-firefox-dev.zip + xpiFilePath: builds/yomitan-firefox-dev.xpi + jwtIssuer: ${{ secrets.FF_JWT_ISSUER }} + jwtSecret: ${{ secrets.FF_JWT_SECRET }} + + - name: Abort on sign error + if: | + steps.ffSignXpi.outcome == 'failure' && + steps.ffSignXpi.outputs.sameVersionAlreadyUploadedError != 'true' + run: exit 1 + + - name: Upload offline xpi release asset + id: uploadReleaseAsset + if: steps.ffSignXpi.outcome == 'success' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: builds/yomitan-firefox.xpi + asset_name: yomitan-firefox.xpi + asset_content_type: application/x-xpinstall + + # update update.json so that all people who have the dev version installed get the new update + + - uses: actions/checkout@v3 + with: + ref: metadata + + - name: Recreate update.json + run: | + cat > update.json << EOF + { + "addons": { + "themoeway+development@googlegroups.com": { + "updates": [ + { + "version": "${{ github.event.release.name }}", + "update_link": "${{ uploadReleaseAsset.browser_download_url }}" + } + ] + } + } + } + EOF + + - name: Commit files + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -a -m "${{ github.event.release.name }} - ${{ github.event.release.html_url }}" + + - name: Push changes + uses: ad-m/github-push-action@0fafdd62b84042d49ec0cb92d9cac7f7ce4ec79e # pin@master + with: + branch: metadata -- cgit v1.2.3 From 1dd47d0876833c1d61572577ae5b9d2215578c07 Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Sat, 18 Mar 2023 11:07:33 +0900 Subject: Fix Firefox manifests --- .github/workflows/publish-firefox-development.yml | 2 +- dev/data/manifest-variants.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to '.github/workflows/publish-firefox-development.yml') diff --git a/.github/workflows/publish-firefox-development.yml b/.github/workflows/publish-firefox-development.yml index 5699311f..0ed07326 100644 --- a/.github/workflows/publish-firefox-development.yml +++ b/.github/workflows/publish-firefox-development.yml @@ -62,7 +62,7 @@ jobs: cat > update.json << EOF { "addons": { - "themoeway+development@googlegroups.com": { + "{2d13e145-294e-4ead-9bce-b4644b203a00}": { "updates": [ { "version": "${{ github.event.release.name }}", diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index f4f5c766..1b0e569d 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -178,7 +178,7 @@ { "action": "delete", "path": [ - "service_worker" + "background" ] }, { @@ -218,7 +218,7 @@ ], "value": { "gecko": { - "id": "themoeway@googlegroups.com", + "id": "{cb7c0bec-7085-4f84-8422-7b55a7c4467c}", "strict_min_version": "101.0" } } @@ -267,7 +267,7 @@ ], "pattern": "^(.*)(?:\\.\\s*)?$", "patternFlags": "", - "replacement": "$1. This is a development build; get the stable version here: https://tinyurl.com/yaatdjmp" + "replacement": "$1. This is a development build." }, { "action": "set", @@ -276,7 +276,7 @@ "gecko", "id" ], - "value": "themoeway+development@googlegroups.com" + "value": "{2d13e145-294e-4ead-9bce-b4644b203a00}" }, { "action": "set", -- cgit v1.2.3