From 64982b3f89de40d5fba865374a00d85988f2de74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Sun, 3 Nov 2024 21:25:00 +0100 Subject: [PATCH] ci: add revision to wowgaming/aowow homepage automatically --- .github/workflows/generate-aowow-database.yml | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/generate-aowow-database.yml b/.github/workflows/generate-aowow-database.yml index b99d2015..ba8c867d 100644 --- a/.github/workflows/generate-aowow-database.yml +++ b/.github/workflows/generate-aowow-database.yml @@ -16,28 +16,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - curl --user wowgaming:${{ secrets.FTP_PASSWORD }} ftp://wowgaming@ftp.wowgaming.altervista.org/aowow/template/pages/home.tpl.php >> home.tpl.php + git clone https://github.com/azerothcore/acore-docker + cd acore-docker + docker compose up -d - file_path="home.tpl.php" - new_commit="NEWCOMMIT" - target_text="AzerothCore rev: $new_commit<\/a>" - - sed -i "/$target_text/c\\$replacement_text" "$file_path" - - curl --user wowgaming:${{ secrets.FTP_PASSWORD }} --upload-file home.tpl.php ftp://wowgaming@ftp.wowgaming.altervista.org/aowow/template/pages/home.tpl.php + cd ../setup/ + + bash generate-db.sh - # git clone https://github.com/azerothcore/acore-docker - # cd acore-docker - # docker compose up -d + cd .. - # cd ../setup/ + revision=`mysql -u root -ppassword -P 63306 -h 127.0.0.1 -s -N -e "SELECT substring_index(substring_index(revision, 'rev. ', -1), '+ 2', 1) FROM acore_auth.uptime ORDER BY starttime DESC LIMIT 1;"` + release_name=$(date '+%Y-%m-%d_%H-%M-%S') + gh release create $release_name --title "$release_name" --notes "Revision: [$revision](https://github.com/azerothcore/azerothcore-wotlk/commit/$revision)" + gh release upload $release_name "aowow_db.sql.zip" - # bash generate-db.sh + curl --user wowgaming:${{ secrets.FTP_PASSWORD }} ftp://wowgaming@ftp.wowgaming.altervista.org/aowow/template/pages/home.tpl.php >> home.tpl.php + + file_path="home.tpl.php" + target_text="AzerothCore rev: $revision<\/a>" - # cd .. + sed -i "/$target_text/c\\$replacement_text" "$file_path" - # revision=`mysql -u root -ppassword -P 63306 -h 127.0.0.1 -s -N -e "SELECT substring_index(substring_index(revision, 'rev. ', -1), '+ 2', 1) FROM acore_auth.uptime ORDER BY starttime DESC LIMIT 1;"` - # release_name=$(date '+%Y-%m-%d_%H-%M-%S') - # gh release create $release_name --title "$release_name" --notes "Revision: [$revision](https://github.com/azerothcore/azerothcore-wotlk/commit/$revision)" - # gh release upload $release_name "aowow_db.sql.zip" + curl --user wowgaming:${{ secrets.FTP_PASSWORD }} --upload-file home.tpl.php ftp://wowgaming@ftp.wowgaming.altervista.org/aowow/template/pages/home.tpl.php