mirror of
https://github.com/YunoHost-Apps/zwiicms_ynh.git
synced 2024-09-03 18:06:04 +02:00
Update workflow
This commit is contained in:
parent
af9d30d630
commit
5b16d7340c
6 changed files with 21 additions and 93 deletions
6
.github/workflows/conf/app.src
vendored
6
.github/workflows/conf/app.src
vendored
|
@ -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=
|
6
.github/workflows/conf/app.src.old
vendored
6
.github/workflows/conf/app.src.old
vendored
|
@ -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=
|
69
.github/workflows/manifest.toml
vendored
69
.github/workflows/manifest.toml
vendored
|
@ -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"
|
26
.github/workflows/updater.sh
vendored
26
.github/workflows/updater.sh
vendored
|
@ -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
|
||||
|
||||
|
|
5
.github/workflows/updater.yml
vendored
5
.github/workflows/updater.yml
vendored
|
@ -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: |
|
||||
|
|
|
@ -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"]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue