Skip to content

Commit

Permalink
ci: add revision to wowgaming/aowow homepage automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Helias authored Nov 3, 2024
1 parent 4bbcd81 commit 64982b3
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/generate-aowow-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl --user wowgaming:${{ secrets.FTP_PASSWORD }} ftp://[email protected]/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: <a href=\"https:\/\/github.com\/azerothcore\/azerothcore-wotlk\/commit\/"
replacement_text=" AzerothCore rev: <a href=\"https:\/\/github.com\/azerothcore\/azerothcore-wotlk\/commit\/$new_commit\">$new_commit<\/a>"
sed -i "/$target_text/c\\$replacement_text" "$file_path"
curl --user wowgaming:${{ secrets.FTP_PASSWORD }} --upload-file home.tpl.php ftp://[email protected]/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://[email protected]/aowow/template/pages/home.tpl.php >> home.tpl.php
file_path="home.tpl.php"
target_text="AzerothCore rev: <a href=\"https:\/\/github.com\/azerothcore\/azerothcore-wotlk\/commit\/"
replacement_text=" AzerothCore rev: <a href=\"https:\/\/github.com\/azerothcore\/azerothcore-wotlk\/commit\/$revision\">$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://[email protected]/aowow/template/pages/home.tpl.php

0 comments on commit 64982b3

Please sign in to comment.