From 9a381096d72dc0f79c589870d652512de99d2159 Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:11:04 +0200 Subject: [PATCH 1/8] Fix getting game version in beta branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c37c556..9181e1b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: "mod_version=$ModVersion" >> $env:GITHUB_ENV Write-Output "ModVersion: ""$ModVersion""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - $GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "([\d.]+)<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value } + $GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "([\d.]+)(?:-beta)<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value } "game_version=$GameVersion" >> $env:GITHUB_ENV Write-Output "GameVersion: ""$GameVersion""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- From 385d51187317cd4d8fd386424fe3a9351e1bf24f Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:26:37 +0200 Subject: [PATCH 2/8] Update to v3.0.3 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index b66f244f..60f32dce 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 3.0.2.0 + 3.0.3.0 1.1.5.21456 Stable 2.2.2 From 7d9ddd824c4a2177417626d8ad0a14bbbe4eaa11 Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:46:28 +0200 Subject: [PATCH 3/8] Fix repo branch name handling in build workflow --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9181e1b1..82664097 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,8 +38,6 @@ jobs: #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- $RepoBranch = "${{github.ref}}" $RepoBranch = $RepoBranch.Split("/")[-1] - If ($RepoBranch -eq "stable") { $RepoBranch = "" } - If ($RepoBranch) { $RepoBranch = "-$RepoBranch" } "repo_branch=$RepoBranch" >> $env:GITHUB_ENV Write-Output "RepoBranch: ""$RepoBranch""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -53,7 +51,8 @@ jobs: "zip_name=$ZipName" >> $env:GITHUB_ENV Write-Output "ZipName: ""$ZipName""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - $TagName = "v$ModVersion$RepoBranch" + If ($RepoBranch -ne "stable") { $RepoBranchAddition = "-$RepoBranch" } + $TagName = "v$ModVersion$RepoBranchAddition" "tag_name=$TagName" >> $env:GITHUB_ENV Write-Output "TagName: ""$TagName""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -80,6 +79,7 @@ jobs: with: tag_name: ${{env.tag_name}} name: ${{env.release_title}} + target_commitish: ${{env.repo_branch}} draft: false prerelease: ${{env.prerelease}} files: ${{env.zip_name}}.zip From 319c9df2302a9256552bfb7993470b08489ed218 Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:50:32 +0200 Subject: [PATCH 4/8] Fix detection of game version in stable branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82664097..4856b98f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: "mod_version=$ModVersion" >> $env:GITHUB_ENV Write-Output "ModVersion: ""$ModVersion""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - $GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "([\d.]+)(?:-beta)<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value } + $GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "([\d.]+)(?:-beta)?<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value } "game_version=$GameVersion" >> $env:GITHUB_ENV Write-Output "GameVersion: ""$GameVersion""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- From 87ba26f43ef2ee8b0a863490c5c1dbad98512bbd Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:52:37 +0200 Subject: [PATCH 5/8] Fix detection of prerelease status --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4856b98f..db2fd0c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,9 +41,7 @@ jobs: "repo_branch=$RepoBranch" >> $env:GITHUB_ENV Write-Output "RepoBranch: ""$RepoBranch""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - $Prerelease = "${{github.ref}}" - $Prerelease = $Prerelease.Split("/")[-1] - If ($Prerelease -eq "stable") { $Prerelease = "false" } Else { $Prerelease = "true" } + If ($GameBranch -eq "Stable") { $Prerelease = "false" } Else { $Prerelease = "true" } "prerelease=$Prerelease" >> $env:GITHUB_ENV Write-Output "Prerelease: ""$Prerelease""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- From 35552436988b3b01a63a84a0e586c2ce10e7fc47 Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:53:42 +0200 Subject: [PATCH 6/8] Fix calculation of tag name in stable-develop --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db2fd0c4..ac05cadf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: "zip_name=$ZipName" >> $env:GITHUB_ENV Write-Output "ZipName: ""$ZipName""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - If ($RepoBranch -ne "stable") { $RepoBranchAddition = "-$RepoBranch" } + If ($Prerelease -eq "true") { $RepoBranchAddition = "-$RepoBranch" } $TagName = "v$ModVersion$RepoBranchAddition" "tag_name=$TagName" >> $env:GITHUB_ENV Write-Output "TagName: ""$TagName""" From b6d6e03ace85c7983bfd86f5f84de62fd90d1f25 Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:54:49 +0200 Subject: [PATCH 7/8] Add game branch to release and artifact names --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac05cadf..ea7ee04b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: "prerelease=$Prerelease" >> $env:GITHUB_ENV Write-Output "Prerelease: ""$Prerelease""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - $ZipName = "BannerlordCheats_v$($ModVersion)_for_v$($GameVersion)" + $ZipName = "BannerlordCheats_v$($ModVersion)_for_$($GameBranch)_v$($GameVersion)" "zip_name=$ZipName" >> $env:GITHUB_ENV Write-Output "ZipName: ""$ZipName""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -54,7 +54,7 @@ jobs: "tag_name=$TagName" >> $env:GITHUB_ENV Write-Output "TagName: ""$TagName""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - $ReleaseTitle = "Release v$($ModVersion) for v$($GameVersion)" + $ReleaseTitle = "Release v$($ModVersion) for $($GameBranch) v$($GameVersion)" "release_title=$ReleaseTitle" >> $env:GITHUB_ENV Write-Output "ReleaseTitle: ""$ReleaseTitle""" From 631105581f5080523569f4d252d9776e5b1d741e Mon Sep 17 00:00:00 2001 From: Nico Welles Date: Wed, 12 Jul 2023 13:56:18 +0200 Subject: [PATCH 8/8] Reverse calculation of prerelease state --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea7ee04b..1bbd3103 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: "repo_branch=$RepoBranch" >> $env:GITHUB_ENV Write-Output "RepoBranch: ""$RepoBranch""" #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - If ($GameBranch -eq "Stable") { $Prerelease = "false" } Else { $Prerelease = "true" } + If ($GameBranch -eq "Beta") { $Prerelease = "true" } Else { $Prerelease = "false" } "prerelease=$Prerelease" >> $env:GITHUB_ENV Write-Output "Prerelease: ""$Prerelease""" #---------------------------------------------------------------------------------------------------------------------------------------------------------------------