name: Compile and Update Compiled Client on: push: branches: - master # Trigger on push to master branch jobs: compile-and-push: runs-on: ubuntu-latest steps: - name: Install dependencies run: sudo apt-get install -y python3-paramiko python3-lxml - name: Checkout Source Repo (Civ14) uses: actions/checkout@v3.6.0 with: submodules: "recursive" - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: 9.0.x - name: Setup Submodule run: git submodule update --init --recursive - name: Pull engine updates uses: space-wizards/submodule-dependency@v0.1.5 - name: Update Engine Submodules run: | cd RobustToolbox/ git submodule update --init --recursive - name: Install dependencies run: dotnet restore - name: Package Client run: dotnet build -c Release -r win-x64 Content.Client - name: Package Server run: dotnet build -c Release -r win-x64 Content.Server - name: Checkout Target Repo (Compiled Client) uses: actions/checkout@v4 with: repository: taislin/civ14_compileds token: ${{ secrets.TARGET_REPO_TOKEN }} path: target-repo - name: Update Target Repo run: | echo "--- Updating Client ---" rsync -avc --delete ./bin/Content.Client/win-x64/ target-repo/Content.Client/ cd target-repo/Content.Client git config user.name "GitHub Action" git config user.email "action@github.com" git add . if ! git diff --staged --quiet; then git commit -m "Update compiled client from Civ14" git push else echo "No client changes to commit." fi cd ${{ github.workspace }} echo "--- Updating Server ---" rsync -avc --delete ./bin/Content.Server/win-x64/ target-repo/Content.Server/ cd target-repo/Content.Server git config user.name "GitHub Action" git config user.email "action@github.com" git add . if ! git diff --staged --quiet; then git commit -m "Update compiled server from Civ14" git push else echo "No server changes to commit." fi cd ${{ github.workspace }} true # Prevent non-zero exit from halting the workflow