Skip to content

Bump Bannerlord.ButterLib from 2.8.9 to 2.8.12 #655

Bump Bannerlord.ButterLib from 2.8.9 to 2.8.12

Bump Bannerlord.ButterLib from 2.8.9 to 2.8.12 #655

Workflow file for this run

name: Build & Release
on:
push:
workflow_dispatch:
jobs:
build:
name: Build & Release
runs-on: windows-latest
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
- name: Check versions and parameters
shell: pwsh
run: |
$ModVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "<Version>([\d.]+)<\/Version>" | % { $($_.Matches.Groups[1]).Value }
$ModVersion = $ModVersion -replace "(?:\.0)+$",""
If ($ModVersion -notmatch "\.") { $ModVersion = "$ModVersion.0" }
"mod_version=$ModVersion" >> $env:GITHUB_ENV
Write-Output "ModVersion: ""$ModVersion"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "<GameVersion>([\d.]+)(?:-beta)?<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value }
"game_version=$GameVersion" >> $env:GITHUB_ENV
Write-Output "GameVersion: ""$GameVersion"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$GameBranch = Get-Content .\Directory.Build.props | Select-String -Pattern "<GameBranch>(.+)<\/GameBranch>" | % { $($_.Matches.Groups[1]).Value }
"game_branch=$GameBranch" >> $env:GITHUB_ENV
Write-Output "GameBranch: ""$GameBranch"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$RepoBranch = "${{github.ref}}"
$RepoBranch = $RepoBranch.Split("/")[-1]
"repo_branch=$RepoBranch" >> $env:GITHUB_ENV
Write-Output "RepoBranch: ""$RepoBranch"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
If ($GameBranch -eq "Beta") { $Prerelease = "true" } Else { $Prerelease = "false" }
"prerelease=$Prerelease" >> $env:GITHUB_ENV
Write-Output "Prerelease: ""$Prerelease"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ZipName = "BannerlordCheats_v$($ModVersion)_for_$($GameBranch)_v$($GameVersion)"
"zip_name=$ZipName" >> $env:GITHUB_ENV
Write-Output "ZipName: ""$ZipName"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
If ($Prerelease -eq "true") { $RepoBranchAddition = "-$RepoBranch" }
$TagName = "v$ModVersion$RepoBranchAddition"
"tag_name=$TagName" >> $env:GITHUB_ENV
Write-Output "TagName: ""$TagName"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ReleaseTitle = "Release v$($ModVersion) for $($GameBranch) v$($GameVersion)"
"release_title=$ReleaseTitle" >> $env:GITHUB_ENV
Write-Output "ReleaseTitle: ""$ReleaseTitle"""
- name: Build Bannerlord Cheats
run: dotnet build BannerlordCheats.csproj --configuration Release -p:GameFolder="${{github.workspace}}\Bannerlord" -p:UseNuGetAssemblies="True"
- name: Package Mod Files
run: 7z a -tzip ${{env.zip_name}}.zip ${{github.workspace}}\Bannerlord\Modules\*
working-directory: ${{github.workspace}}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.zip_name}}
path: ${{github.workspace}}\Bannerlord\Modules
- name: Create Release
uses: softprops/action-gh-release@v1
if: ${{ github.ref_name == 'stable' || github.ref_name == 'beta' }}
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