From 75a78cdc19d533cd05da28aa403eb2067f10fa81 Mon Sep 17 00:00:00 2001 From: Meisterlala <6453306+Meisterlala@users.noreply.github.com> Date: Thu, 1 May 2025 23:20:25 +0200 Subject: [PATCH] updated build --- build.ps1 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/build.ps1 b/build.ps1 index 066a8b3..fd6444b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -10,16 +10,10 @@ docker buildx version | Out-Null # Set up Docker Buildx builder docker buildx create --use --name tucan-builder --driver docker-container --bootstrap 2>$null | Out-Null -# Fetch the latest version or initialize if not found -$latestVersion = docker manifest inspect "${imageName}:latest" --verbose 2>$null | Select-String -Pattern "org.opencontainers.image.version" | ForEach-Object { ($_ -split ':')[1].Trim() } +# Fetch the latest version from Git tags +$latestVersion = git describe --tags --abbrev=0 2>$null if (-Not $latestVersion) { $latestVersion = "0.1.0" } -# Increment the version number -$versionParts = $latestVersion -split '\.' -$versionParts[2] = [int]$versionParts[2] + 1 -$newVersion = "$($versionParts[0]).$($versionParts[1]).$($versionParts[2])" -Write-Host "New version: $newVersion" - # Build and push the Docker image -docker buildx build --platform $platforms -t "${imageName}:${newVersion}" -t "${imageName}:latest" --push . +docker buildx build --platform $platforms -t "${imageName}:${latestVersion}" -t "${imageName}:latest" --push . Write-Host "Build and push completed successfully." -- 2.51.2