diff --git a/.github/workflows/conf/app.src b/.github/workflows/conf/app.src deleted file mode 100644 index baf0c16..0000000 --- a/.github/workflows/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://forge.chapril.org/ZwiiCMS-Team/ZwiiCMS/archive/12.2.04.tar.gz -SOURCE_SUM=c56be62e6e6f7eabe57f4eea4e5d17d8538488ce28962135879074635f3151c3 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT= -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/.github/workflows/conf/app.src.old b/.github/workflows/conf/app.src.old deleted file mode 100644 index 1420727..0000000 --- a/.github/workflows/conf/app.src.old +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://forge.chapril.org/ZwiiCMS-Team/ZwiiCMS/archive/12.2.04.tar.gz -SOURCE_SUM=c56be62e6e6f7eabe57f4eea4e5d17d8538488ce28962135879074635f3151c3 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/.github/workflows/manifest.toml b/.github/workflows/manifest.toml deleted file mode 100644 index 5c24534..0000000 --- a/.github/workflows/manifest.toml +++ /dev/null @@ -1,69 +0,0 @@ -packaging_format = 2 - -id = "zwiicms" -name = "ZwiiCMS" -description.en = "Zwii - the simple, lightweight, database-free (Flat-File), scalable and responsive CMS!" -description.fr = "Zwii - le CMS simple, léger, sans base de données (Flat-File), modulable et responsive !" - -version = "12.2.04~ynh1" - -maintainers = ["ewilly"] - -[upstream] -license = " AGPL-3.0-or-later" -website = "https://zwiicms.com/" -admindoc = "" -userdoc = "https://www.zwiicms.fr/prise-en-main" -code = "https://forge.chapril.org/ZwiiCMS-Team/ZwiiCMS" -fund = "https://ko-fi.com/T6T4FPG1A" - -[integration] -yunohost = ">= 11.1.6" -architectures = "all" -multi_instance = false -ldap = "not_relevant" -sso = "not_relevant" -disk = "50M" -ram.build = "50M" -ram.runtime = "50M" - -[install] - [install.domain] - type = "domain" - - [install.path] - type = "path" - default = "/zwiicms" - - [install.init_main_permission] - type = "group" - default = "visitors" - - [install.language] - ask.en = "Choose the application language" - ask.fr = "Choisissez la langue de l'application" - type = "string" - choices = ["fr_FR", "es", "it", "pt_PT", "en_EN", "gr_GR"] - default = "fr_FR" - - [install.admin] - type = "user" - - [install.password] - help.en = "Use the help field to add an information for the admin about this question." - help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - type = "password" - -[resources] - [resources.system_user] - - [resources.install_dir] - dir = "/var/www/__APP__" - owner = "__APP__:rwx" - group = "www-data:rx" - - [resources.permissions] - main.url = "/" - - [resources.apt] - packages = "php$YNH_DEFAULT_PHP_VERSION-mbstring,php$YNH_DEFAULT_PHP_VERSION-zip,php$YNH_DEFAULT_PHP_VERSION-GD,php$YNH_DEFAULT_PHP_VERSION-exif,php$YNH_DEFAULT_PHP_VERSION-XMLWriter" diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 310c08c..eeec05c 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -17,8 +17,8 @@ #================================================= # Fetching information -current_version=$(cat manifest.toml | awk -v key="version" '$1 == key { gsub("\"","",$3);print $3 }' | awk -F'~' '{print $1}') -repo=$(cat manifest.toml | awk -v key="code" '$1 == key { gsub("\"","",$3);print $3 }' | awk -F'https://forge.chapril.org/' '{print $2}') +current_version=$(cat manifest.toml | tomlq -j '.version|split("~")[0]') +repo=$(cat manifest.toml | tomlq -j '.upstream.code|split("https://github.com/")[1]') version=$(curl --silent "https://forge.chapril.org/api/v1/repos/$repo/releases?draft=false&pre-release=false&limit=1" | jq -r '.[] | .tag_name') asset_url=$(curl --silent "https://forge.chapril.org/api/v1/repos/$repo/releases?draft=false&pre-release=false&limit=1" | jq -r '.[] | .tarball_url') @@ -26,8 +26,9 @@ asset_url=$(curl --silent "https://forge.chapril.org/api/v1/repos/$repo/releases # 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} +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]] +then + version=${version:1} fi # Setting up the environment variables @@ -39,13 +40,15 @@ echo "REPO=$repo" >> $GITHUB_ENV 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 +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 +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 #================================================= @@ -70,7 +73,6 @@ SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= EOT echo "... conf/app.src updated" @@ -87,6 +89,8 @@ echo "... conf/app.src updated" # Replace new version in manifest sed -i "s/^version = .*/version = \"$version~ynh1\"/" manifest.toml +#DOES NOT WORK BECAUSE IT REORDER ALL THE MANIFEST IN A STRANGE WAY +#echo "$(tomlq --toml-output --slurp --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.toml)" > manifest.toml # No need to update the README, yunohost-bot takes care of it diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index 137e440..392e0ec 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -17,6 +17,11 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install python + uses: actions/setup-python@v4 + - name: Install yq/tomlq + id: install_yq + run: pip install yq - name: Run the updater script id: run_updater run: | diff --git a/README.md b/README.md index e273a69..281d145 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in - Open source -**Shipped version:** 12.2.04~ynh1 +**Shipped version:** 12.2.04~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index a415af0..14457ef 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,7 +34,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po - Open source -**Version incluse :** 12.2.04~ynh1 +**Version incluse :** 12.2.04~ynh2 ## Captures d’écran diff --git a/manifest.toml b/manifest.toml index 5c24534..441b5fd 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "ZwiiCMS" description.en = "Zwii - the simple, lightweight, database-free (Flat-File), scalable and responsive CMS!" description.fr = "Zwii - le CMS simple, léger, sans base de données (Flat-File), modulable et responsive !" -version = "12.2.04~ynh1" +version = "12.2.04~ynh2" maintainers = ["ewilly"]