From 58806a183d2dfda3f702b2550717f2e316f9ba69 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Mon, 28 Feb 2022 16:06:03 +0000 Subject: [PATCH 1/4] Add updater.sh --- .github/workflows/updater.sh | 103 ++++++++++++++++++++++++++++++++++ .github/workflows/updater.yml | 49 ++++++++++++++++ manifest.json | 5 ++ 3 files changed, 157 insertions(+) create mode 100644 .github/workflows/updater.sh create mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..2a6f88e --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) +assets="https://github.com/$repo/archive/refs/tags/$version.tar.gz" + +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then + version=${version:1} +fi + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $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 ! dpkg --compare-versions "$current_version" "lt" "$version" ; 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 ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +# Let's download source tarball +asset_url=$assets +echo "Handling asset at $asset_url" +src="app" + +# Create the temporary directory +tempdir="$(mktemp -d)" + +# Download sources and calculate checksum +filename=${asset_url##*/} +curl --silent -4 -L $asset_url -o "$tempdir/$filename" +checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + +# Delete temporary directory +rm -rf $tempdir + +# Get extension +if [[ $filename == *.tar.gz ]]; then + extension=tar.gz +else + extension=${filename##*.} +fi + +# Rewrite source file +cat < conf/$src.src +SOURCE_URL=$asset_url +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=$extension +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +EOT +echo "... conf/$src.src updated" + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# 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.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# 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 upstream 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@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - 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.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + 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.json b/manifest.json index 568a077..e76a5c3 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,11 @@ }, "version": "2.3.9~ynh2", "url": "https://photoview.github.io/", + "upstream": { + "license": "AGPL-3.0-or-later", + "website": "https://photoview.github.io/", + "code": "https://github.com/photoview/photoview" + }, "license": "AGPL-3.0-only", "maintainer": { "name": "Jules Bertholet", From 4e6b121290e65fa8e710b4455db9cec3de854878 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Mon, 28 Feb 2022 16:06:32 +0000 Subject: [PATCH 2/4] Upgrade to 2.3.12~ynh1 --- conf/app.src | 7 +++---- manifest.json | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conf/app.src b/conf/app.src index 38ee37a..f88f803 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,6 @@ -SOURCE_URL=https://github.com/photoview/photoview/archive/refs/tags/v2.3.9.tar.gz -SOURCE_SUM=f5daaab41061f86c94b029914131f363d0774b29ace5db942c4ef6511914708e +SOURCE_URL=https://github.com/photoview/photoview/archive/refs/tags/v2.3.12.tar.gz +SOURCE_SUM=f9de00fb2d854217655a71264c06f8451b06b67170d3a5bbd9160fc94f1dda0f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=v2.3.9.tar.gz -SOURCE_EXTRACT=true +SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index e76a5c3..c60fb9a 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Simple and user-friendly photo gallery that's made for photographers ", "fr": "Galerie photos simple et facile à utiliser, faite pour les photographes" }, - "version": "2.3.9~ynh2", + "version": "2.3.12~ynh1", "url": "https://photoview.github.io/", "upstream": { "license": "AGPL-3.0-or-later", @@ -27,7 +27,7 @@ "mysql" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain", From 989b99ccc7b67d494cbfb129f07a390ff7ec57ff Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Tue, 1 Mar 2022 13:33:55 -0500 Subject: [PATCH 3/4] Update libheif to v1.12.0 --- conf/libheif.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/libheif.src b/conf/libheif.src index 44a6069..24a3d49 100644 --- a/conf/libheif.src +++ b/conf/libheif.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/strukturag/libheif/releases/download/v1.11.0/libheif-1.11.0.tar.gz -SOURCE_SUM=c550938f56ff6dac83702251a143f87cb3a6c71a50d8723955290832d9960913 +SOURCE_URL=https://github.com/strukturag/libheif/releases/download/v1.12.0/libheif-1.12.0.tar.gz +SOURCE_SUM=e1ac2abb354fdc8ccdca71363ebad7503ad731c84022cf460837f0839e171718 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=libheif-1.11.0.tar.gz +SOURCE_FILENAME=libheif-1.12.0.tar.gz SOURCE_EXTRACT=true From 0b750942a6d425c9008e098f9e6e2a3d5616da06 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 3 Mar 2022 17:08:22 +0000 Subject: [PATCH 4/4] Auto-update README --- README.md | 48 +++++++++++++++--------------------------------- README_fr.md | 48 +++++++++++++----------------------------------- 2 files changed, 28 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index e93c769..9b45cfc 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,32 @@ + + # Photoview for YunoHost [![Integration level](https://dash.yunohost.org/integration/photoview.svg)](https://dash.yunohost.org/appci/app/photoview) ![](https://ci-apps.yunohost.org/ci/badges/photoview.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/photoview.maintain.svg) -[![Install photoview with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=photoview) +[![Install Photoview with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=photoview) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Photoview quickly and simply on a YunoHost server. +> *This package allows you to install Photoview quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Photoview is a simple and user-friendly photo gallery that's made for photographers and aims to provide an easy and fast way to navigate directories, with thousands of high resolution photos. -**Shipped version:** 2.3.9 +Simple and user-friendly photo gallery that's made for photographers -## Screenshots +**Shipped version:** 2.3.12~ynh1 -![](https://github.com/photoview/photoview/raw/master/screenshots/timeline.png) -## Demo -* [Official demo](https://photos.qpqp.dk/) Username: **demo** Password: **demo** - -## Configuration - -You can access an admin panel from the web interface. - -## Documentation - -* Official documentation: https://photoview.github.io/docs/ - -#### Multi-user support - -Are LDAP and HTTP auth supported? **No** -Can the app be used by multiple users? **Yes** - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/photoview.svg)](https://ci-apps.yunohost.org/ci/apps/photoview/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/photoview.svg)](https://ci-apps-arm.yunohost.org/ci/apps/photoview/) - -## Links +## Documentation and resources +* Official app website: https://photoview.github.io/ +* Upstream app code repository: https://github.com/photoview/photoview +* YunoHost documentation for this app: https://yunohost.org/app_photoview * Report a bug: https://github.com/YunoHost-Apps/photoview_ynh/issues -* App website: https://photoview.github.io/ -* Upstream app repository: https://github.com/photoview/photoview -* YunoHost website: https://yunohost.org/ - ---- ## Developer info @@ -58,3 +38,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/photoview_ynh/tree/te or sudo yunohost app upgrade photoview -u https://github.com/YunoHost-Apps/photoview_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 8667afd..ad19c3c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,52 +1,28 @@ # Photoview pour YunoHost [![Niveau d'intégration](https://dash.yunohost.org/integration/photoview.svg)](https://dash.yunohost.org/appci/app/photoview) ![](https://ci-apps.yunohost.org/ci/badges/photoview.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/photoview.maintain.svg) -[![Installer photoview avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=photoview) +[![Installer Photoview avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=photoview) *[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* -> *Ce package vous permet d'installer Photoview rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* +> *Ce package vous permet d'installer Photoview rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble -Photoview est une galerie photos simple et facile à utiliser, conçue pour les photographes et qui vise à fournir un moyen simple et rapide pour naviguer dans les dossiers contenant des milliers de photos haute résolution. -**Version incluse :** 2.3.9 +Galerie photos simple et facile à utiliser, faite pour les photographes -## Captures d'écran +**Version incluse :** 2.3.12~ynh1 -![](https://github.com/photoview/photoview/raw/master/screenshots/timeline.png) -## Démo -* [Démo officielle](https://photos.qpqp.dk/) Nom d'utilisateur: **demo** Mot de pase: **demo** +## Documentations et ressources -## Configuration - -Vous pouvez accéder à un panneau admin depuis l'interface web. - -## Documentation - -* Documentation officielle : https://photoview.github.io/docs/ - -#### Support multi-utilisateur - -* L'authentification LDAP et HTTP est-elle prise en charge ? **Non** -* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** - -#### Architectures supportées - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/photoview.svg)](https://ci-apps.yunohost.org/ci/apps/photoview/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/photoview.svg)](https://ci-apps-arm.yunohost.org/ci/apps/photoview/) - -## Liens - -* Signaler un bug : https://github.com/YunoHost-Apps/photoview_ynh/issues -* Site de l'application : https://photoview.github.io/ -* Dépôt de l'application principale : https://github.com/photoview/photoview -* Site web YunoHost : https://yunohost.org/ - ---- +* Site officiel de l'app : https://photoview.github.io/ +* Dépôt de code officiel de l'app : https://github.com/photoview/photoview +* Documentation YunoHost pour cette app : https://yunohost.org/app_photoview +* Signaler un bug : https://github.com/YunoHost-Apps/photoview_ynh/issues ## Informations pour les développeurs @@ -58,3 +34,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/photoview_ynh/tree/te ou sudo yunohost app upgrade photoview -u https://github.com/YunoHost-Apps/photoview_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file