1
0

upload-client.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. echo "--- Updating Client ---"
  44. rsync -av --delete --update ./bin/Content.Client/win-x64/ target-repo/Content.Client/
  45. cd target-repo/Content.Client
  46. git config user.name "GitHub Action"
  47. git config user.email "action@github.com"
  48. git add .
  49. # Check if there are staged changes. git diff exits 0 if no changes, 1 if changes.
  50. if git diff --staged --quiet; then
  51. echo "No client changes to commit."
  52. else
  53. git commit -m "Update compiled client from Civ14"
  54. git push
  55. fi
  56. # Go back to the workspace root before processing the server
  57. cd ${{ github.workspace }}
  58. echo "--- Updating Server ---"
  59. rsync -av --delete --update ./bin/Content.Server/win-x64/ target-repo/Content.Server/
  60. cd target-repo/Content.Server
  61. git config user.name "GitHub Action"
  62. git config user.email "action@github.com"
  63. git add .
  64. # Check if there are staged changes
  65. if git diff --staged --quiet; then
  66. echo "No server changes to commit."
  67. else
  68. git commit -m "Update compiled server from Civ14"
  69. git push
  70. fi