From 9d4fba78a8c8ff7818ce8e9e2d1500ba738b6218 Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 22 Jun 2024 16:56:31 +0200 Subject: [PATCH 1/6] Add automatic update checking This soultion uses the Flathub Bot since it is easy to implement and works well for this use case. A GitHub Action is set to make it run once a week. Makefile was updated as well to reflect the changes. --- .github/workflows/update-check.yml | 29 +++++++++++++++++++++++++++++ Makefile | 5 +++-- dev.aunetx.deezer.json | 22 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-check.yml create mode 100644 dev.aunetx.deezer.json diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml new file mode 100644 index 0000000..42641cf --- /dev/null +++ b/.github/workflows/update-check.yml @@ -0,0 +1,29 @@ +name: Check for updates +on: + schedule: # for scheduling to work this file must be in the default branch + - cron: "0 0 * * 1" # run every Monday + workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab + +jobs: + flatpak-external-data-checker: + runs-on: ubuntu-latest + + strategy: + matrix: + branch: [ master ] # list all branches to check + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ matrix.branch }} + + - uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest + env: + GIT_AUTHOR_NAME: Flatpak External Data Checker + GIT_COMMITTER_NAME: Flatpak External Data Checker + # email sets "github-actions[bot]" as commit author, see https://github.community/t/github-actions-bot-email-address/17204/6 + GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: --update --never-fork dev.aunetx.deezer.json \ No newline at end of file diff --git a/Makefile b/Makefile index 9a9c8c6..aab0d2e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ # Maintainer: Aurélien Hamy APPNAME = dev.aunetx.deezer -PKGVER = 6.0.110 -BASE_URL = https://www.deezer.com/desktop/download/artifact/win32/x86/$(PKGVER) +BASE_URL = $(shell jq ".modules[0].sources[0].url" dev.aunetx.deezer.json) +SHA256 = $(shell jq ".modules[0].sources[0].sha256" dev.aunetx.deezer.json) +PKGVER = $(shell echo $(BASE_URL) | grep -Eo "([0-9]+\.[0-9]+\.[0-9]+)" | head -1) VERSION_REGEX = ^v$(PKGVER)-[0-9]{1,}$$ diff --git a/dev.aunetx.deezer.json b/dev.aunetx.deezer.json new file mode 100644 index 0000000..b1638c8 --- /dev/null +++ b/dev.aunetx.deezer.json @@ -0,0 +1,22 @@ +{ + "app-id": "dev.aunetx.deezer", + "modules": [ + { + "name": "deezer", + "sources": [ + { + "type": "archive", + "url": "https://e-cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/6.0.150/DeezerDesktopSetup_6.0.150.exe", + "sha256": "0ecf85dc7988bc1c26bf12f22b800eeb813b943b7453b8ac5fa9a103ccc075f5", + "only-arches": ["x86_64"], + "dest": "archive", + "x-checker-data": { + "type": "rotating-url", + "url": "https://www.deezer.com/desktop/download?platform=win32&architecture=x86", + "pattern": "([\\d]+\\.[\\d]+\\.[\\d]+)" + } + } + ] + } + ] +} From 8fc400e267c05e448ffcd48647a303e6fe42d49e Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 22 Jun 2024 17:00:03 +0200 Subject: [PATCH 2/6] Add SHA256 verification It is compared against the FlaHub's bot calculated SHA256 --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index aab0d2e..9eb1437 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ prepare: clean install_build_deps @echo "Download installer" @wget -nv -c $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe + @echo "$(SHA256) deezer-setup-$(PKGVER).exe" | sha256sum -c --status || echo "SHA256 not matching!" && exit 1 @echo "Extract app archive from installer" @cd source && 7z x -so deezer-setup-$(PKGVER).exe '$$PLUGINSDIR/app-32.7z' > app-32.7z From 11c0432a2648bb8f0a2e746894e4b38abc307ce0 Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 22 Jun 2024 17:18:17 +0200 Subject: [PATCH 3/6] Fix deezer-setup path for sha256sum --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9eb1437..63901b2 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ prepare: clean install_build_deps @echo "Download installer" @wget -nv -c $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe - @echo "$(SHA256) deezer-setup-$(PKGVER).exe" | sha256sum -c --status || echo "SHA256 not matching!" && exit 1 + @echo "$(SHA256) source/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || echo "SHA256 not matching!" && exit 1 @echo "Extract app archive from installer" @cd source && 7z x -so deezer-setup-$(PKGVER).exe '$$PLUGINSDIR/app-32.7z' > app-32.7z From e6bb283da2cf1b1f8f23b78cdc8b561264fec355 Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 22 Jun 2024 17:38:06 +0200 Subject: [PATCH 4/6] Remove -c option from wget Compared to deezer.com, e-cdn-content.dzcdn.net does not support resuming a download --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 63901b2..a556754 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ prepare: clean install_build_deps @mkdir -p source @echo "Download installer" - @wget -nv -c $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe + @wget -nv $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe @echo "$(SHA256) source/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || echo "SHA256 not matching!" && exit 1 @echo "Extract app archive from installer" From c2cd7e5b6a466125585341503f78f56be06c5c83 Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 22 Jun 2024 17:39:49 +0200 Subject: [PATCH 5/6] Simplify sha256sum check --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a556754..77c815e 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,9 @@ prepare: clean install_build_deps @echo "Download installer" @wget -nv $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe - @echo "$(SHA256) source/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || echo "SHA256 not matching!" && exit 1 + + @echo "Verify installer" + @echo "$(SHA256) source/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || exit 1 @echo "Extract app archive from installer" @cd source && 7z x -so deezer-setup-$(PKGVER).exe '$$PLUGINSDIR/app-32.7z' > app-32.7z From 6d5479cfa7e2fd3cc9395e40125806b6315f747d Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 22 Jun 2024 18:24:38 +0200 Subject: [PATCH 6/6] Update actions/checkout to v4 --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 42641cf..b37991d 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -13,7 +13,7 @@ jobs: branch: [ master ] # list all branches to check steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch }}