From 27ebc3e29baa28491e393ba6192b402a58eb1acf Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 16:37:19 +0100 Subject: [PATCH 01/26] fix: not a git repo --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98baf55..6a68dea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,9 @@ jobs: outputs: new_version: ${{ steps.bump_version.outputs.new_version }} steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Ensure branch is main if: github.ref != 'refs/heads/main' run: | From 0c80caf4ac598316932fdc4b76a5c13990b799bb Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 16:37:27 +0100 Subject: [PATCH 02/26] fix: not a git repo --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a68dea..5247a8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,12 +28,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Ensure branch is main - if: github.ref != 'refs/heads/main' - run: | - text="Publish a new version can only be done from the main branch." - echo "::error title=Wrong Branch::$text" - exit 1 +# - name: Ensure branch is main +# if: github.ref != 'refs/heads/main' +# run: | +# text="Publish a new version can only be done from the main branch." +# echo "::error title=Wrong Branch::$text" +# exit 1 - name: Read current version run: | From 45cb3011ea3015a9a3be00380f245fb14165a5ce Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 16:49:18 +0100 Subject: [PATCH 03/26] fix: permissions to update vars --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5247a8c..1ab2147 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -85,6 +85,6 @@ jobs: - name: Update version var id: write_version env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.VAR_UPDATE_GITHUB }} run: | gh variable set VERSION --body "${{ steps.bump_version.outputs.new_version }}" From 4a35926ed424f8e34a7dd629be9165a7770a7f75 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 16:56:46 +0100 Subject: [PATCH 04/26] feat: add release step --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ab2147..2d5ae41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,3 +88,38 @@ jobs: GITHUB_TOKEN: ${{ secrets.VAR_UPDATE_GITHUB }} run: | gh variable set VERSION --body "${{ steps.bump_version.outputs.new_version }}" + + build: + uses: ./.github/workflows/build.yml + with: + VERSION: ${{ needs.update-version.outputs.new_version }} + needs: + [ + update-version + ] + + release: + runs-on: ubuntu-latest + permissions: write-all + needs: + [ + build + ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Artifact + uses: actions/download-artifact@v4 + + - name: Create Release + working-directory: './StatusSwift' + env: + GH_TOKEN: ${{github.token}} + run: | + ls -R + + # gh release create v${{needs.update-version.outputs.new_version}} --generate-notes + + # Compress-Archive -Path .\AppPackages -DestinationPath .\AppPackages.zip + # gh release upload v${{needs.update-version.outputs.new_version}} .\AppPackages.zip From 101423539e35052dc7ce70b09525bce138418ea0 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 16:58:18 +0100 Subject: [PATCH 05/26] fix: working dir --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d5ae41..ea06e71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ concurrency: jobs: # Get the Current Version and Bump it depending on the release-type input update-version: + name: "Update TapToQR Version" runs-on: ubuntu-latest permissions: write-all outputs: @@ -100,6 +101,7 @@ jobs: release: runs-on: ubuntu-latest + name: "Create TapToQR Release" permissions: write-all needs: [ @@ -113,7 +115,6 @@ jobs: uses: actions/download-artifact@v4 - name: Create Release - working-directory: './StatusSwift' env: GH_TOKEN: ${{github.token}} run: | From 498a92cca0edf759bceb477e6aac7f8ec63dc2ac Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:01:09 +0100 Subject: [PATCH 06/26] feat: add release artifact --- .github/workflows/release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea06e71..f5d2325 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -115,12 +115,9 @@ jobs: uses: actions/download-artifact@v4 - name: Create Release + working-directory: './TapToQR-addon' env: GH_TOKEN: ${{github.token}} run: | - ls -R - - # gh release create v${{needs.update-version.outputs.new_version}} --generate-notes - - # Compress-Archive -Path .\AppPackages -DestinationPath .\AppPackages.zip - # gh release upload v${{needs.update-version.outputs.new_version}} .\AppPackages.zip + gh release create v${{needs.update-version.outputs.new_version}} --generate-notes + gh release upload v${{needs.update-version.outputs.new_version}} .\TapToQR-${{needs.update-version.outputs.new_version}}.zip From b7a95d9cb17fbd2a9a3f770d19e97fd3abaeaf95 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:17:22 +0100 Subject: [PATCH 07/26] feat: fix needs --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5d2325..8c7a4f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,7 +105,8 @@ jobs: permissions: write-all needs: [ - build + build, + update-version ] steps: - name: Checkout code @@ -119,5 +120,6 @@ jobs: env: GH_TOKEN: ${{github.token}} run: | + echo "Creating release v${{needs.update-version.outputs.new_version}}" gh release create v${{needs.update-version.outputs.new_version}} --generate-notes gh release upload v${{needs.update-version.outputs.new_version}} .\TapToQR-${{needs.update-version.outputs.new_version}}.zip From e0570177840e53993a02cf5bdf08e3aa0e5060ce Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:23:38 +0100 Subject: [PATCH 08/26] feat: fix needs --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c7a4f6..f401fce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,5 +121,6 @@ jobs: GH_TOKEN: ${{github.token}} run: | echo "Creating release v${{needs.update-version.outputs.new_version}}" + ls gh release create v${{needs.update-version.outputs.new_version}} --generate-notes gh release upload v${{needs.update-version.outputs.new_version}} .\TapToQR-${{needs.update-version.outputs.new_version}}.zip From e87d767323f0f6d1ed87cb686c94653d8926a307 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:26:48 +0100 Subject: [PATCH 09/26] feat: fix path to artifact --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f401fce..58a6da6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,6 +121,5 @@ jobs: GH_TOKEN: ${{github.token}} run: | echo "Creating release v${{needs.update-version.outputs.new_version}}" - ls gh release create v${{needs.update-version.outputs.new_version}} --generate-notes - gh release upload v${{needs.update-version.outputs.new_version}} .\TapToQR-${{needs.update-version.outputs.new_version}}.zip + gh release upload v${{needs.update-version.outputs.new_version}} TapToQR-${{needs.update-version.outputs.new_version}}.zip From ae3a6cd4ef3eb8e896043b0d7d8d85ca29fe03f5 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:51:05 +0100 Subject: [PATCH 10/26] feat: add firefox publish --- .github/workflows/release.yml | 40 ++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58a6da6..32cfcdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -115,11 +115,35 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 - - name: Create Release - working-directory: './TapToQR-addon' - env: - GH_TOKEN: ${{github.token}} - run: | - echo "Creating release v${{needs.update-version.outputs.new_version}}" - gh release create v${{needs.update-version.outputs.new_version}} --generate-notes - gh release upload v${{needs.update-version.outputs.new_version}} TapToQR-${{needs.update-version.outputs.new_version}}.zip +# - name: Create Release +# working-directory: './TapToQR-addon' +# env: +# GH_TOKEN: ${{github.token}} +# run: | +# echo "Creating release v${{needs.update-version.outputs.new_version}}" +# gh release create v${{needs.update-version.outputs.new_version}} --generate-notes +# gh release upload v${{needs.update-version.outputs.new_version}} TapToQR-${{needs.update-version.outputs.new_version}}.zip + + release-firefox: + runs-on: ubuntu-latest + name: "Create TapToQR Firefox Release" + permissions: write-all + needs: + [ + build, + update-version + ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Artifact + uses: actions/download-artifact@v4 + + - uses: wdzeng/firefox-addon@a6c520c + with: + addon-guid: "taptoqr@moritzreis.dev" + xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip + self-hosted: false + jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} + jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} From b63d541f77ac05e55746e60585dba0c750e6b058 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:52:36 +0100 Subject: [PATCH 11/26] fix: full hash --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32cfcdf..7bcfd4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,9 +99,9 @@ jobs: update-version ] - release: + release-github: runs-on: ubuntu-latest - name: "Create TapToQR Release" + name: "Create TapToQR Github Release" permissions: write-all needs: [ @@ -140,7 +140,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 - - uses: wdzeng/firefox-addon@a6c520c + - uses: wdzeng/firefox-addon@a6c520c479eb79861995faf3fa3e271c1b277820 with: addon-guid: "taptoqr@moritzreis.dev" xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip From 8e1c4c4ce9a3a6bc204ed980e78a6e73f22de548 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 17:54:47 +0100 Subject: [PATCH 12/26] fix: full hash --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bcfd4a..e24dd07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,7 +140,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 - - uses: wdzeng/firefox-addon@a6c520c479eb79861995faf3fa3e271c1b277820 + - uses: wdzeng/firefox-addon@1c933bcfc899dad45719bc23ec8c607d51bf8c06 with: addon-guid: "taptoqr@moritzreis.dev" xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip From 66389f65b939dc4d83799e48cf9285e636f920f9 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 18:38:51 +0100 Subject: [PATCH 13/26] fix: add chrome publish --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e24dd07..4f88e76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,10 +140,40 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 - - uses: wdzeng/firefox-addon@1c933bcfc899dad45719bc23ec8c607d51bf8c06 - with: - addon-guid: "taptoqr@moritzreis.dev" - xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip - self-hosted: false - jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} - jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} +# - uses: wdzeng/firefox-addon@1c933bcfc899dad45719bc23ec8c607d51bf8c06 +# name: "Upload to Firefox Addon Store" +# with: +# addon-guid: "taptoqr@moritzreis.dev" +# xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip +# self-hosted: false +# jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} +# jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} + + release-chrome: + runs-on: ubuntu-latest + name: "Create TapToQR Chrome Release" + permissions: write-all + needs: + [ + build, + update-version + ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Artifact + uses: actions/download-artifact@v4 + + - name: "Setup Google Webstore CLI" + run: | + npm install -g chrome-webstore-upload-cli + + - name: "Upload to Chrome Webstore" + run: |- + chrome-webstore-upload \\ + --source "TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip" \\ + --extension-id "ommdikomjapdndpedljobeecepeopjmp" \\ + --client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \\ + --client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \\ + --refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }} From 76edcc7dda6b10957c33ef49ee6e8e8b691eb3c0 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 18:44:46 +0100 Subject: [PATCH 14/26] fix: file path --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f88e76..8c55135 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,8 +171,9 @@ jobs: - name: "Upload to Chrome Webstore" run: |- + cd TapToQR-addon chrome-webstore-upload \\ - --source "TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip" \\ + --source TapToQR-${{needs.update-version.outputs.new_version}}.zip \\ --extension-id "ommdikomjapdndpedljobeecepeopjmp" \\ --client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \\ --client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \\ From a16c4e24c39aa15eef3213afd422efbb9e595044 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 18:52:28 +0100 Subject: [PATCH 15/26] fix: add ls to debug --- .github/workflows/release.yml | 5 +++++ addon/manifest.json | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c55135..45102b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -172,6 +172,11 @@ jobs: - name: "Upload to Chrome Webstore" run: |- cd TapToQR-addon + + # unzip the artifact + unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip + ls -R + chrome-webstore-upload \\ --source TapToQR-${{needs.update-version.outputs.new_version}}.zip \\ --extension-id "ommdikomjapdndpedljobeecepeopjmp" \\ diff --git a/addon/manifest.json b/addon/manifest.json index 1723b50..d116cc3 100644 --- a/addon/manifest.json +++ b/addon/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "TapToQR", - "version": "1.1.0", + "version": "0.0.0", "description": "Instantly generate and share a QR code for the webpage you're currently viewing, making link sharing seamless and quick.", "author": "Moritz Reis", "icons": { @@ -37,7 +37,8 @@ }, "browser_specific_settings": { "gecko": { - "id": "taptoqr@moritzreis.dev" + "id": "taptoqr@moritzreis.dev", + "strict_min_version": "121.0" } } } From 0e3ba08e7b0816a1d7745320a82f1df309944ab3 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 18:55:57 +0100 Subject: [PATCH 16/26] fix: manifest not found --- .github/workflows/release.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45102b4..f5ebbae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -158,6 +158,13 @@ jobs: build, update-version ] + + env: + EXTENSION_ID: "ommdikomjapdndpedljobeecepeopjmp" + CLIENT_ID: ${{ secrets.CI_GOOGLE_CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} + REFRESH_TOKEN: ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }} + steps: - name: Checkout code uses: actions/checkout@v4 @@ -173,13 +180,7 @@ jobs: run: |- cd TapToQR-addon - # unzip the artifact unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip - ls -R + rm TapToQR-${{needs.update-version.outputs.new_version}}.zip - chrome-webstore-upload \\ - --source TapToQR-${{needs.update-version.outputs.new_version}}.zip \\ - --extension-id "ommdikomjapdndpedljobeecepeopjmp" \\ - --client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \\ - --client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \\ - --refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }} + chrome-webstore-upload From abc9979cfba613d9069acccfda9b971af7c62432 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sat, 21 Dec 2024 19:01:14 +0100 Subject: [PATCH 17/26] feat: add edge store publish --- .github/workflows/release.yml | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5ebbae..ffd0009 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,7 +127,6 @@ jobs: release-firefox: runs-on: ubuntu-latest name: "Create TapToQR Firefox Release" - permissions: write-all needs: [ build, @@ -152,7 +151,6 @@ jobs: release-chrome: runs-on: ubuntu-latest name: "Create TapToQR Chrome Release" - permissions: write-all needs: [ build, @@ -176,11 +174,26 @@ jobs: run: | npm install -g chrome-webstore-upload-cli - - name: "Upload to Chrome Webstore" - run: |- - cd TapToQR-addon - - unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip - rm TapToQR-${{needs.update-version.outputs.new_version}}.zip - - chrome-webstore-upload +# - name: "Upload to Chrome Webstore" +# run: |- +# cd TapToQR-addon +# +# unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip +# rm TapToQR-${{needs.update-version.outputs.new_version}}.zip +# +# chrome-webstore-upload + + release-edge: + runs-on: ubuntu-latest + name: "Create TapToQR Edge Release" + needs: + [ + build, + update-version + ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Artifact + uses: actions/download-artifact@v4 From 8ee79555b5ae6e29e247910c3833184c7a5034f3 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:15:20 +0100 Subject: [PATCH 18/26] feat: add edge store publish --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffd0009..756e254 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -197,3 +197,10 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 + + - uses: wdzeng/edge-addon@d4db1eea77297a24d799394dec87e8912e0902f9 + with: + product-id: "1cc708c2-05e8-4339-9fdb-ddca04acf678" + zip-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip + api-key: ${{ secrets.MICROSOFT_API_KEY }} + client-id: ${{ secrets.MICROSOFT_CLIENT_ID }} From 79d894baa48ef66d2e0df6de1845dde0eab62bab Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:22:42 +0100 Subject: [PATCH 19/26] feat: add switches to control where the extension is published --- .github/workflows/release.yml | 89 +++++++++++++++++++++++------------ addon/manifest.json | 3 +- 2 files changed, 60 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 756e254..ca22638 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,10 @@ name: "Release TapToQR" on: workflow_dispatch: inputs: + skip-update: + description: "Skip the version update step" + required: false + default: false release-type: type: choice description: Which type of release to create? @@ -12,6 +16,26 @@ on: - patch - minor - major + publish-firefox: + type: boolean + description: Should the Firefox Addon be published? + required: false + default: true + publish-chrome: + type: boolean + description: Should the Chrome Extension be published? + required: false + default: true + publish-edge: + type: boolean + description: Should the Edge Extension be published? + required: false + default: true + publish-github: + type: boolean + description: Should the Github Release be published? + required: false + default: true concurrency: group: ${{ github.workflow }} @@ -21,6 +45,7 @@ jobs: # Get the Current Version and Bump it depending on the release-type input update-version: name: "Update TapToQR Version" + if: ${{ !github.event.inputs.skip-update }} runs-on: ubuntu-latest permissions: write-all outputs: @@ -29,12 +54,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 -# - name: Ensure branch is main -# if: github.ref != 'refs/heads/main' -# run: | -# text="Publish a new version can only be done from the main branch." -# echo "::error title=Wrong Branch::$text" -# exit 1 + - name: Ensure branch is main + if: github.ref != 'refs/heads/main' + run: | + text="Publish a new version can only be done from the main branch." + echo "::error title=Wrong Branch::$text" + exit 1 - name: Read current version run: | @@ -102,6 +127,7 @@ jobs: release-github: runs-on: ubuntu-latest name: "Create TapToQR Github Release" + if: ${{ github.event.inputs.publish-github }} permissions: write-all needs: [ @@ -115,18 +141,19 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 -# - name: Create Release -# working-directory: './TapToQR-addon' -# env: -# GH_TOKEN: ${{github.token}} -# run: | -# echo "Creating release v${{needs.update-version.outputs.new_version}}" -# gh release create v${{needs.update-version.outputs.new_version}} --generate-notes -# gh release upload v${{needs.update-version.outputs.new_version}} TapToQR-${{needs.update-version.outputs.new_version}}.zip + - name: Create Release + working-directory: './TapToQR-addon' + env: + GH_TOKEN: ${{github.token}} + run: | + echo "Creating release v${{needs.update-version.outputs.new_version}}" + gh release create v${{needs.update-version.outputs.new_version}} --generate-notes + gh release upload v${{needs.update-version.outputs.new_version}} TapToQR-${{needs.update-version.outputs.new_version}}.zip release-firefox: runs-on: ubuntu-latest name: "Create TapToQR Firefox Release" + if: ${{ github.event.inputs.publish-firefox }} needs: [ build, @@ -139,18 +166,19 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 -# - uses: wdzeng/firefox-addon@1c933bcfc899dad45719bc23ec8c607d51bf8c06 -# name: "Upload to Firefox Addon Store" -# with: -# addon-guid: "taptoqr@moritzreis.dev" -# xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip -# self-hosted: false -# jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} -# jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} + - uses: wdzeng/firefox-addon@1c933bcfc899dad45719bc23ec8c607d51bf8c06 + name: "Upload to Firefox Addon Store" + with: + addon-guid: "taptoqr@moritzreis.dev" + xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip + self-hosted: false + jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} + jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} release-chrome: runs-on: ubuntu-latest name: "Create TapToQR Chrome Release" + if: ${{ github.event.inputs.publish-chrome }} needs: [ build, @@ -174,18 +202,19 @@ jobs: run: | npm install -g chrome-webstore-upload-cli -# - name: "Upload to Chrome Webstore" -# run: |- -# cd TapToQR-addon -# -# unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip -# rm TapToQR-${{needs.update-version.outputs.new_version}}.zip -# -# chrome-webstore-upload + - name: "Upload to Chrome Webstore" + run: |- + cd TapToQR-addon + + unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip + rm TapToQR-${{needs.update-version.outputs.new_version}}.zip + + chrome-webstore-upload release-edge: runs-on: ubuntu-latest name: "Create TapToQR Edge Release" + if: ${{ github.event.inputs.publish-edge }} needs: [ build, diff --git a/addon/manifest.json b/addon/manifest.json index d116cc3..19a857c 100644 --- a/addon/manifest.json +++ b/addon/manifest.json @@ -37,8 +37,7 @@ }, "browser_specific_settings": { "gecko": { - "id": "taptoqr@moritzreis.dev", - "strict_min_version": "121.0" + "id": "taptoqr@moritzreis.dev" } } } From c21da88db1db1c601b48f9c679d03ccbfad5b090 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:24:34 +0100 Subject: [PATCH 20/26] fix: switch type --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca22638..9ba9f76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: workflow_dispatch: inputs: skip-update: + type: boolean description: "Skip the version update step" required: false default: false From 083728616fc94254f5208fd56eb36c63436beb1a Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:26:40 +0100 Subject: [PATCH 21/26] fix: skip only relevant steps --- .github/workflows/release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ba9f76..6c0833a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,6 @@ jobs: # Get the Current Version and Bump it depending on the release-type input update-version: name: "Update TapToQR Version" - if: ${{ !github.event.inputs.skip-update }} runs-on: ubuntu-latest permissions: write-all outputs: @@ -55,12 +54,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Ensure branch is main - if: github.ref != 'refs/heads/main' - run: | - text="Publish a new version can only be done from the main branch." - echo "::error title=Wrong Branch::$text" - exit 1 +# - name: Ensure branch is main +# if: github.ref != 'refs/heads/main' +# run: | +# text="Publish a new version can only be done from the main branch." +# echo "::error title=Wrong Branch::$text" +# exit 1 - name: Read current version run: | @@ -68,6 +67,7 @@ jobs: - name: Bump version id: bump_version + if: ${{ !github.event.inputs.skip-update }} run: | # Retrieve the increment type from the GitHub Actions input increment="${{ inputs.release-type }}" @@ -111,6 +111,7 @@ jobs: - name: Update version var id: write_version + if: ${{ !github.event.inputs.skip-update }} env: GITHUB_TOKEN: ${{ secrets.VAR_UPDATE_GITHUB }} run: | From 753dc94bb9f31dc3dbce52bd470f13a044df0aab Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:35:04 +0100 Subject: [PATCH 22/26] fix: version output --- .github/workflows/build.yml | 8 ++++++++ .github/workflows/release.yml | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcd77f8..d1d7680 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,11 @@ on: type: string required: false + outputs: + VERSION: + description: "The version of the addon to build" + value: ${{ jobs.build-artifact.outputs.VERSION }} + workflow_call: inputs: VERSION: @@ -31,6 +36,9 @@ jobs: name: "Build TapToQR Artifact" runs-on: ubuntu-latest + outputs: + VERSION: ${{ steps.determine-version.outputs.VERSION }} + steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c0833a..b7c9036 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: skip-update: type: boolean description: "Skip the version update step" - required: false + required: true default: false release-type: type: choice @@ -20,22 +20,22 @@ on: publish-firefox: type: boolean description: Should the Firefox Addon be published? - required: false + required: true default: true publish-chrome: type: boolean description: Should the Chrome Extension be published? - required: false + required: true default: true publish-edge: type: boolean description: Should the Edge Extension be published? - required: false + required: true default: true publish-github: type: boolean description: Should the Github Release be published? - required: false + required: true default: true concurrency: @@ -148,9 +148,9 @@ jobs: env: GH_TOKEN: ${{github.token}} run: | - echo "Creating release v${{needs.update-version.outputs.new_version}}" - gh release create v${{needs.update-version.outputs.new_version}} --generate-notes - gh release upload v${{needs.update-version.outputs.new_version}} TapToQR-${{needs.update-version.outputs.new_version}}.zip + echo "Creating release v${{needs.build.outputs.VERSION}}" + gh release create v${{needs.build.outputs.VERSION}} --generate-notes + gh release upload v${{needs.build.outputs.VERSION}} TapToQR-${{needs.build.outputs.VERSION}}.zip release-firefox: runs-on: ubuntu-latest @@ -172,7 +172,7 @@ jobs: name: "Upload to Firefox Addon Store" with: addon-guid: "taptoqr@moritzreis.dev" - xpi-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip + xpi-path: TapToQR-addon/TapToQR-${{needs.build.outputs.VERSION}}.zip self-hosted: false jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} @@ -208,8 +208,8 @@ jobs: run: |- cd TapToQR-addon - unzip TapToQR-${{needs.update-version.outputs.new_version}}.zip - rm TapToQR-${{needs.update-version.outputs.new_version}}.zip + unzip TapToQR-${{needs.build.outputs.VERSION}}.zip + rm TapToQR-${{needs.build.outputs.VERSION}}.zip chrome-webstore-upload @@ -232,6 +232,6 @@ jobs: - uses: wdzeng/edge-addon@d4db1eea77297a24d799394dec87e8912e0902f9 with: product-id: "1cc708c2-05e8-4339-9fdb-ddca04acf678" - zip-path: TapToQR-addon/TapToQR-${{needs.update-version.outputs.new_version}}.zip + zip-path: TapToQR-addon/TapToQR-${{needs.build.outputs.VERSION}}.zip api-key: ${{ secrets.MICROSOFT_API_KEY }} client-id: ${{ secrets.MICROSOFT_CLIENT_ID }} From ba220f4aa0e1c1124ffa75f7014418700a23c3a5 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:36:37 +0100 Subject: [PATCH 23/26] fix: workflow output --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1d7680..9114ece 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,17 +8,17 @@ on: type: string required: false - outputs: - VERSION: - description: "The version of the addon to build" - value: ${{ jobs.build-artifact.outputs.VERSION }} - workflow_call: inputs: VERSION: description: "The version of the addon to build" type: string required: false + outputs: + VERSION: + description: "The version of the addon to build" + value: ${{ jobs.build-artifact.outputs.VERSION }} + push: branches: - main From 508591ca262a96aa33561f2e84da5d05962557a1 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:46:35 +0100 Subject: [PATCH 24/26] fix: manifest for edge --- .github/workflows/release.yml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7c9036..d315a9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,12 +129,11 @@ jobs: release-github: runs-on: ubuntu-latest name: "Create TapToQR Github Release" - if: ${{ github.event.inputs.publish-github }} + if: ${{ github.event.inputs.publish-github == true }} permissions: write-all needs: [ - build, - update-version + build ] steps: - name: Checkout code @@ -155,11 +154,10 @@ jobs: release-firefox: runs-on: ubuntu-latest name: "Create TapToQR Firefox Release" - if: ${{ github.event.inputs.publish-firefox }} + if: ${{ github.event.inputs.publish-firefox == true }} needs: [ - build, - update-version + build ] steps: - name: Checkout code @@ -180,11 +178,10 @@ jobs: release-chrome: runs-on: ubuntu-latest name: "Create TapToQR Chrome Release" - if: ${{ github.event.inputs.publish-chrome }} + if: ${{ github.event.inputs.publish-chrome == true }} needs: [ - build, - update-version + build ] env: @@ -216,11 +213,10 @@ jobs: release-edge: runs-on: ubuntu-latest name: "Create TapToQR Edge Release" - if: ${{ github.event.inputs.publish-edge }} + if: ${{ github.event.inputs.publish-edge == true }} needs: [ - build, - update-version + build ] steps: - name: Checkout code @@ -229,6 +225,16 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 + - name: Prepare Artifact + run: | + cd TapToQR-addon + unzip TapToQR-${{needs.build.outputs.VERSION}}.zip + rm TapToQR-${{needs.build.outputs.VERSION}}.zip + FILE="manifest.json" + jq 'del(.browser_specific_settings)' "$FILE" > temp_manifest.json && mv temp_manifest.json "$FILE" + # zip again + zip -r TapToQR-${{needs.build.outputs.VERSION}}.zip ./* + - uses: wdzeng/edge-addon@d4db1eea77297a24d799394dec87e8912e0902f9 with: product-id: "1cc708c2-05e8-4339-9fdb-ddca04acf678" From f3667e256c3c849205e806722035d15bde65b6d2 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:50:39 +0100 Subject: [PATCH 25/26] fix: condition --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d315a9a..6481093 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: - name: Bump version id: bump_version - if: ${{ !github.event.inputs.skip-update }} + if: ${{ github.event.inputs.skip-update == 'false' }} run: | # Retrieve the increment type from the GitHub Actions input increment="${{ inputs.release-type }}" @@ -111,7 +111,7 @@ jobs: - name: Update version var id: write_version - if: ${{ !github.event.inputs.skip-update }} + if: ${{ github.event.inputs.skip-update == 'false' }} env: GITHUB_TOKEN: ${{ secrets.VAR_UPDATE_GITHUB }} run: | @@ -129,7 +129,7 @@ jobs: release-github: runs-on: ubuntu-latest name: "Create TapToQR Github Release" - if: ${{ github.event.inputs.publish-github == true }} + if: ${{ github.event.inputs.publish-github == 'true' }} permissions: write-all needs: [ @@ -154,7 +154,7 @@ jobs: release-firefox: runs-on: ubuntu-latest name: "Create TapToQR Firefox Release" - if: ${{ github.event.inputs.publish-firefox == true }} + if: ${{ github.event.inputs.publish-firefox == 'true' }} needs: [ build @@ -178,7 +178,7 @@ jobs: release-chrome: runs-on: ubuntu-latest name: "Create TapToQR Chrome Release" - if: ${{ github.event.inputs.publish-chrome == true }} + if: ${{ github.event.inputs.publish-chrome == 'true' }} needs: [ build @@ -213,7 +213,7 @@ jobs: release-edge: runs-on: ubuntu-latest name: "Create TapToQR Edge Release" - if: ${{ github.event.inputs.publish-edge == true }} + if: ${{ github.event.inputs.publish-edge == 'true' }} needs: [ build From b0b296d2fb5c4c6a8590a4f58a5db0b6bb401215 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 22 Dec 2024 12:54:52 +0100 Subject: [PATCH 26/26] chore: cleanup --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6481093..3db21ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,12 +54,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 -# - name: Ensure branch is main -# if: github.ref != 'refs/heads/main' -# run: | -# text="Publish a new version can only be done from the main branch." -# echo "::error title=Wrong Branch::$text" -# exit 1 + - name: Ensure branch is main + if: github.ref != 'refs/heads/main' + run: | + text="Publish a new version can only be done from the main branch." + echo "::error title=Wrong Branch::$text" + exit 1 - name: Read current version run: |