From 58c5b870920866a4f4b28848973054f9fa9431db Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 19 Mar 2023 21:30:20 +0100 Subject: [PATCH] Fix auto-updater --- .github/workflows/updater.sh | 6 +++--- .github/workflows/updater.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 9778395..5e34d44 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -14,9 +14,9 @@ #================================================= # Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +current_version=$(cat manifest.toml | tomlq -r '.version|split("~")[0]') current_project_version=$(grep -Po 'project_version="\K[^"]*' scripts/_common.sh) -core_repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +core_repo=$(cat manifest.toml | tomlq -r '.upstream.code|split("https://github.com/")[1]') project_repo="flarum/flarum" # Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) # Core version may be higher than project version, and we actually download the project then perform Composer install. @@ -104,7 +104,7 @@ echo "scripts/_common.sh patched" #================================================= # Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json +sed -i "/version =/c\version = \"$version~ynh1\"" 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 609c284..d997959 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -23,6 +23,8 @@ jobs: # Setting up Git user git config --global user.name 'yunohost-bot' git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Download yq/tomlq + pip install yq # Run the updater script /bin/bash .github/workflows/updater.sh - name: Commit changes