upload-client.yml 2.4 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: git submodule update --init --recursive
  22. - name: Pull engine updates
  23. uses: space-wizards/submodule-dependency@v0.1.5
  24. - name: Update Engine Submodules
  25. run: |
  26. cd RobustToolbox/
  27. git submodule update --init --recursive
  28. - name: Install dependencies
  29. run: dotnet restore
  30. - name: Package Client
  31. run: dotnet build -c Release -r win-x64 Content.Client
  32. - name: Package Server
  33. run: dotnet build -c Release -r win-x64 Content.Server
  34. - name: Checkout Target Repo (Compiled Client)
  35. uses: actions/checkout@v4
  36. with:
  37. repository: taislin/civ14_compileds
  38. token: ${{ secrets.TARGET_REPO_TOKEN }}
  39. path: target-repo
  40. - name: Update Target Repo
  41. run: |
  42. echo "--- Updating Client ---"
  43. rsync -avc --delete ./bin/Content.Client/win-x64/ target-repo/Content.Client/
  44. cd target-repo/Content.Client
  45. git config user.name "GitHub Action"
  46. git config user.email "action@github.com"
  47. git add .
  48. if ! git diff --staged --quiet; then
  49. git commit -m "Update compiled client from Civ14"
  50. git push
  51. else
  52. echo "No client changes to commit."
  53. fi
  54. cd ${{ github.workspace }}
  55. echo "--- Updating Server ---"
  56. rsync -avc --delete ./bin/Content.Server/win-x64/ target-repo/Content.Server/
  57. cd target-repo/Content.Server
  58. git config user.name "GitHub Action"
  59. git config user.email "action@github.com"
  60. git add .
  61. if ! git diff --staged --quiet; then
  62. git commit -m "Update compiled server from Civ14"
  63. git push
  64. else
  65. echo "No server changes to commit."
  66. fi
  67. cd ${{ github.workspace }}
  68. true # Prevent non-zero exit from halting the workflow