From 24887ac7ff785c819915c7b8d7e0db380b84e7e0 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 10 Dec 2023 03:14:39 +0000 Subject: [PATCH] Enhancement (ci): Add job for the `.state` update commit to mirror latest build status --- .gitlab-ci.yml | 20 ++++++++++++++++++++ Generate-GitBranches.ps1 | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 72128bbb..1a04e3d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,3 +49,23 @@ notify: script: - apk add --no-cache curl - ./notify.sh + +state: + stage: build + image: alpine:3.15 + rules: + # Run on steam-* branches when .state is added or modified + - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH =~ /^steam-\w+-\w+$/ + changes: + - .state + when: always + timeout: 5m + script: + - | + set -eu + . .state + if [ "$BUILD_STATUS" = 'success' ]; then + exit 0 + else + exit 1 + fi diff --git a/Generate-GitBranches.ps1 b/Generate-GitBranches.ps1 index 37730cc0..f003c602 100644 --- a/Generate-GitBranches.ps1 +++ b/Generate-GitBranches.ps1 @@ -208,7 +208,7 @@ try { @" PIPELINE=update GAME_UPDATE_COUNT=$( if ($kv.Contains('GAME_UPDATE_COUNT')) { $kv['GAME_UPDATE_COUNT'] } else { $g['game_update_count'] } ) -GAME_VERSION=$( $g['game_version'] ) +GAME_VERSION=$( if ($kv.Contains('GAME_VERSION')) { $kv['GAME_VERSION'] } else { $g['game_version'] } ) APPID=$( $g['appid'] ) CLIENT_APPID=$( $g['client_appid'] ) GAME=$( $g['game'] )