From ec4534f871088e8cc31d6d700d8ff46864158813 Mon Sep 17 00:00:00 2001 From: asya Date: Fri, 11 Sep 2026 17:20:37 +0300 Subject: [PATCH 1/2] added yaml --- .github/workflows/kick_build.yml | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/kick_build.yml diff --git a/.github/workflows/kick_build.yml b/.github/workflows/kick_build.yml new file mode 100644 index 0000000..76fe0b0 --- /dev/null +++ b/.github/workflows/kick_build.yml @@ -0,0 +1,44 @@ +name: "Build Game" + +on: + pull_request: + types: + - opened + - edited + - synchronize + workflow_dispatch: + inputs: + branch: + description: 'Branch to build' + default: 'main' + required: false + type: string + + +permissions: + pull-requests: read + +jobs: + + kick-game-build: + name: Kick Game Build + runs-on: ubuntu-latest + + steps: + - id: start-build + name: Start TeamCity Build + run: | + response=$(curl --header "Authorization: Bearer ${{ secrets.TEAMCITY_TOKEN }}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --request POST --data "{\"branchName\": \"${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.head_ref }}\", \"buildType\": { \"id\": \"Sdk_GameProjects_BuildCampfire\"} }" \ + https://coherence.teamcity.com/app/rest/buildQueue) + + url=$( jq -r '.webUrl' <<< "${response}" ) + + if [ -z "${url}" ] || [ "${url}" = "null" ]; then + echo "Failed to start TeamCity build. Response: ${response}" >&2 + exit 1 + fi + + echo "Build started: ${url}" From 1da35e5793b000cb4d6c2af54442baf294c5658b Mon Sep 17 00:00:00 2001 From: asya Date: Fri, 11 Sep 2026 23:10:41 +0300 Subject: [PATCH 2/2] added check --- .github/workflows/kick_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kick_build.yml b/.github/workflows/kick_build.yml index 76fe0b0..0bcc5fb 100644 --- a/.github/workflows/kick_build.yml +++ b/.github/workflows/kick_build.yml @@ -34,7 +34,7 @@ jobs: --request POST --data "{\"branchName\": \"${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.head_ref }}\", \"buildType\": { \"id\": \"Sdk_GameProjects_BuildCampfire\"} }" \ https://coherence.teamcity.com/app/rest/buildQueue) - url=$( jq -r '.webUrl' <<< "${response}" ) + url=$( jq -r '.webUrl' <<< "${response}" 2>/dev/null ) || url="" if [ -z "${url}" ] || [ "${url}" = "null" ]; then echo "Failed to start TeamCity build. Response: ${response}" >&2