upload-client.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: Compile and Update Compiled Client
  2. on:
  3. push:
  4. branches:
  5. - master # Trigger on push to master branch
  6. jobs:
  7. compile-and-push:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Install dependencies
  11. run: sudo apt-get install -y python3-paramiko python3-lxml
  12. - name: Checkout Source Repo (Civ14)
  13. uses: actions/checkout@v3.6.0
  14. with:
  15. submodules: "recursive"
  16. - name: Setup .NET Core
  17. uses: actions/setup-dotnet@v3.2.0
  18. with:
  19. dotnet-version: 9.0.x
  20. - name: Setup Submodule
  21. run: |
  22. git submodule update --init --recursive
  23. - name: Pull engine updates
  24. uses: space-wizards/submodule-dependency@v0.1.5
  25. - name: Update Engine Submodules
  26. run: |
  27. cd RobustToolbox/
  28. git submodule update --init --recursive
  29. - name: Install dependencies
  30. run: dotnet restore
  31. - name: Package Client
  32. run: dotnet build -c Release -r win-x64 Content.Client
  33. - name: Package Server
  34. run: dotnet build -c Release -r win-x64 Content.Server
  35. - name: Checkout Target Repo (Compiled Client)
  36. uses: actions/checkout@v4
  37. with:
  38. repository: taislin/civ14_compileds
  39. token: ${{ secrets.TARGET_REPO_TOKEN }}
  40. path: target-repo
  41. - name: Update Target Repo
  42. run: |
  43. # Copy compiled output to target-repo/
  44. rsync -av --ignore-existing ./bin/Content.Client/win-x64/ target-repo/Content.Client/ || true
  45. cd target-repo
  46. cd Content.Client
  47. git config user.name "GitHub Action"
  48. git config user.email "action@github.com"
  49. git add .
  50. if git status --porcelain | grep .; then
  51. git commit -m "Update compiled client from Civ14 - changed files only"
  52. git push
  53. else
  54. echo "No changes detected, skipping commit and push"
  55. fi
  56. cd -
  57. # Copy compiled output to target-repo/
  58. rsync -av --ignore-existing ./../bin/Content.Server/win-x64/ Content.Server/ || true
  59. cd Content.Server
  60. git config user.name "GitHub Action"
  61. git config user.email "action@github.com"
  62. git add .
  63. if git status --porcelain | grep .; then
  64. git commit -m "Update compiled server from Civ14 - changed files only"
  65. git push
  66. else
  67. echo "No changes detected, skipping commit and push"
  68. fi