From ed8d81ccfb976e372bccc0c530021a69988a0af7 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 27 Aug 2024 08:01:15 +0200 Subject: [PATCH 1/2] Update ffmpeg-static version --- .github/workflows/updater_ffmpeg-static.sh | 54 ++++++++++++++++++++ .github/workflows/updater_ffmpeg-static.yml | 56 +++++++++++++++++++++ manifest.toml | 6 +-- 3 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/updater_ffmpeg-static.sh create mode 100644 .github/workflows/updater_ffmpeg-static.yml diff --git a/.github/workflows/updater_ffmpeg-static.sh b/.github/workflows/updater_ffmpeg-static.sh new file mode 100644 index 0000000..a978ee6 --- /dev/null +++ b/.github/workflows/updater_ffmpeg-static.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#================================================= +# FETCHING LATEST SHA256SUM +#================================================= + +# Fetching information +version_current=$(cat manifest.toml | tomlq -j '.version') +version_app=$(cat manifest.toml | tomlq -j '.version|split("~ynh")[0]') +version_ynh=$(cat manifest.toml | tomlq -j '.version|split("~ynh")[1]') +version_next="$version_app~ynh($version_ynh+1)" +repo=$(cat manifest.toml | tomlq -j '.upstream.code|split("https://github.com/")[1]') + +amd64_url=$(cat manifest.toml | tomlq -j '.resources.sources.ffmpeg-static.amd64.url') +amd64_sha_current=$(cat manifest.toml | tomlq -j '.resources.sources.ffmpeg-static.amd64.sha256') +amd64_sha_last=$(curl --silent "$amd64_url" | sha256sum) + +arm64_url=$(cat manifest.toml | tomlq -j '.resources.sources.ffmpeg-static.arm64.url') +arm64_sha_current=$(cat manifest.toml | tomlq -j '.resources.sources.ffmpeg-static.arm64.sha256') +arm64_sha_last=$(curl --silent "$arm64_url" | sha256sum) + +# Setting up the environment variables +echo "Current version: $version_current" +echo "Latest version: $version_next" +echo "VERSION=$version_next" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if [ "$amd64_sha_current" == "$amd64_sha_last" ] And [ "$arm64_sha_current" == "$amd64_sha_last" ] +then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version_next ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +sed -i "s/^version = .*/version = \"$version_next\"/" manifest.toml + +# Replace sha356sum in manifest +sed -i "s@^\"amd64.sha256\" = .*@\"amd64.sha256\" = \"$amd64_sha_last\"@" manifest.toml +sed -i "s@^\"arm64.sha256\" = .*@\"arm64.sha256\" = \"$arm64_sha_last\"@" manifest.toml + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/.github/workflows/updater_ffmpeg-static.yml b/.github/workflows/updater_ffmpeg-static.yml new file mode 100644 index 0000000..d01cf61 --- /dev/null +++ b/.github/workflows/updater_ffmpeg-static.yml @@ -0,0 +1,56 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new ffmpeg-static releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install yq/tomlq + id: install_yq + run: pip install yq + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater_ffmpeg-static.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request to testing + id: cpr-testing + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/manifest.toml b/manifest.toml index 2e63800..91ebaee 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Immich" description.en = "Photo and video backup solution directly from your mobile phone" description.fr = "Sauvegarde de photos et de vidéos directement depuis votre mobile" -version = "1.112.1~ynh1" +version = "1.112.1~ynh2" maintainers = ["ewilly"] @@ -49,9 +49,9 @@ ram.runtime = "500M" [resources.sources.ffmpeg-static] amd64.url = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" - amd64.sha256 = "5341ac10c505b9217740790d56d8e63e590d74ca81e3e56796e4c98f7be80b61" + amd64.sha256 = "abda8d77ce8309141f83ab8edf0596834087c52467f6badf376a6a2a4c87cf67" arm64.url = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz" - arm64.sha256 = "7387f7aae3ae88cbaad5c66155fdf23ce0c0dbeaf4b1e573d704817938cd1b8e" + arm64.sha256 = "f4149bb2b0784e30e99bdda85471c9b5930d3402014e934a5098b41d0f7201b1" [resources.ports] main.default = 3001 From f4db23fddaf81322cf0bde540396447b2f0d8a24 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 27 Aug 2024 06:00:31 +0000 Subject: [PATCH 2/2] Auto-update READMEs --- README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 2 +- README_ru.md | 2 +- README_zh_Hans.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4ebdfc3..996c656 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Shipped version:** 1.112.1~ynh1 +**Shipped version:** 1.112.1~ynh2 ## Screenshots diff --git a/README_es.md b/README_es.md index cd83e87..e2af9e7 100644 --- a/README_es.md +++ b/README_es.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Versión actual:** 1.112.1~ynh1 +**Versión actual:** 1.112.1~ynh2 ## Capturas diff --git a/README_eu.md b/README_eu.md index af1a011..107746a 100644 --- a/README_eu.md +++ b/README_eu.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Paketatutako bertsioa:** 1.112.1~ynh1 +**Paketatutako bertsioa:** 1.112.1~ynh2 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index e035a8a..abad9d5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,7 @@ Solution d'autohébergement pour a gestion de vos photos et vidéos. - Interface conviviale et egronomique ; -**Version incluse :** 1.112.1~ynh1 +**Version incluse :** 1.112.1~ynh2 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 07b3c57..ef1ab74 100644 --- a/README_gl.md +++ b/README_gl.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Versión proporcionada:** 1.112.1~ynh1 +**Versión proporcionada:** 1.112.1~ynh2 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md index 8714d74..efcb8c5 100644 --- a/README_id.md +++ b/README_id.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Versi terkirim:** 1.112.1~ynh1 +**Versi terkirim:** 1.112.1~ynh2 ## Tangkapan Layar diff --git a/README_ru.md b/README_ru.md index dcf7760..6f46ab5 100644 --- a/README_ru.md +++ b/README_ru.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Поставляемая версия:** 1.112.1~ynh1 +**Поставляемая версия:** 1.112.1~ynh2 ## Снимки экрана diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 644b838..5ac5a31 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**分发版本:** 1.112.1~ynh1 +**分发版本:** 1.112.1~ynh2 ## 截图