Removed gitversion, added minversion
This commit is contained in:
parent
daead29d31
commit
1a9491617a
3 changed files with 26 additions and 45 deletions
|
|
@ -2,6 +2,13 @@ stages:
|
||||||
- build
|
- build
|
||||||
- publish
|
- publish
|
||||||
|
|
||||||
|
# Only create pipelines automatically when a Git tag is pushed.
|
||||||
|
# Otherwise the pipeline must be started manually (pipeline "Run" / dispatch equivalent).
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_TAG'
|
||||||
|
when: always
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
||||||
DOTNET_NOLOGO: "true"
|
DOTNET_NOLOGO: "true"
|
||||||
|
|
@ -34,19 +41,18 @@ publish_nuget:
|
||||||
git fetch --prune --unshallow || true
|
git fetch --prune --unshallow || true
|
||||||
git fetch origin +refs/heads/*:refs/remotes/origin/* || true
|
git fetch origin +refs/heads/*:refs/remotes/origin/* || true
|
||||||
git branch --show-current || true
|
git branch --show-current || true
|
||||||
dotnet tool install --global GitVersion.Tool --version 6.5.1 || true
|
|
||||||
export PATH="$PATH:$HOME/.dotnet/tools"
|
# If build was triggered by a Git tag, use that tag as the package version (strip leading 'v').
|
||||||
|
# Otherwise rely on MinVer inside the project to infer a semantic version from git history.
|
||||||
# Build a NuGet-safe version: MajorMinorPatch-EscapedBranchName.PreReleaseNumber
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
MM=$(dotnet-gitversion /showvariable MajorMinorPatch 2>/dev/null || gitversion /showvariable MajorMinorPatch 2>/dev/null || echo "0.1.0")
|
PACKAGE_VERSION="${CI_COMMIT_TAG#v}"
|
||||||
BR=$(dotnet-gitversion /showvariable EscapedBranchName 2>/dev/null || gitversion /showvariable EscapedBranchName 2>/dev/null || echo "master")
|
echo "Using tag version: $PACKAGE_VERSION"
|
||||||
PR=$(dotnet-gitversion /showvariable PreReleaseNumber 2>/dev/null || gitversion /showvariable PreReleaseNumber 2>/dev/null || echo "0")
|
dotnet pack src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj -c Release -o nuget --no-build /p:PackageVersion="$PACKAGE_VERSION" /p:EnableWindowsTargeting=true
|
||||||
PACKAGE_VERSION="${MM}-${BR}.${PR}"
|
else
|
||||||
PACKAGE_VERSION=$(echo "$PACKAGE_VERSION" | sed 's/[^0-9A-Za-z.-]//g')
|
echo "No tag detected; using MinVer to infer version at pack time"
|
||||||
echo "Package version: $PACKAGE_VERSION"
|
dotnet pack src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj -c Release -o nuget --no-build /p:EnableWindowsTargeting=true
|
||||||
dotnet pack src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj -c Release -o nuget --no-build /p:PackageVersion="$PACKAGE_VERSION" /p:Version="$PACKAGE_VERSION" /p:EnableWindowsTargeting=true
|
fi
|
||||||
|
|
||||||
dotnet nuget push "nuget/*.nupkg" --source "$NUGET_SOURCE" --api-key "$CI_JOB_TOKEN" --skip-duplicate
|
dotnet nuget push "nuget/*.nupkg" --source "$NUGET_SOURCE" --api-key "$CI_JOB_TOKEN" --skip-duplicate
|
||||||
only:
|
# Pipeline creation is controlled by the top-level `workflow` rules.
|
||||||
- main
|
# This job will run when the pipeline is created for a tag or when manually started.
|
||||||
- master
|
|
||||||
- tags
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
mode: ContinuousDelivery
|
|
||||||
branches:
|
|
||||||
main:
|
|
||||||
regex: ^main$
|
|
||||||
increment: Minor
|
|
||||||
track-merge-target: false
|
|
||||||
master:
|
|
||||||
regex: ^master$
|
|
||||||
increment: Minor
|
|
||||||
track-merge-target: false
|
|
||||||
feature:
|
|
||||||
regex: ^(?:feat(?:ure)?|feature)[/\\-]
|
|
||||||
increment: Minor
|
|
||||||
source-branches: ["main", "master"]
|
|
||||||
hotfix:
|
|
||||||
regex: ^hotfix[/\\-]
|
|
||||||
increment: Patch
|
|
||||||
ignore:
|
|
||||||
sha: []
|
|
||||||
commit-message-incrementing: Enabled
|
|
||||||
|
|
@ -11,14 +11,9 @@
|
||||||
<Company>Maddo</Company>
|
<Company>Maddo</Company>
|
||||||
<Description>Core library for AIFotoONLUS image processing and recognition.</Description>
|
<Description>Core library for AIFotoONLUS image processing and recognition.</Description>
|
||||||
<RepositoryUrl>https://gitlab.com/MaddoScientisto/aifotoonlus</RepositoryUrl>
|
<RepositoryUrl>https://gitlab.com/MaddoScientisto/aifotoonlus</RepositoryUrl>
|
||||||
<!-- Use GitVersion MSBuild properties to set package version during CI/build. Provide fallback if variable is not defined.
|
<!-- Versioning: use MinVer to infer semantic versions from Git tags. When no tag is present,
|
||||||
Sanitize the GitVersion output to remove characters invalid for NuGet (e.g., braces) -->
|
projects will fall back to the default below. -->
|
||||||
<!-- Prefer composing a safe version from concrete GitVersion MSBuild properties when available -->
|
<Version>0.1.0</Version>
|
||||||
<GitVersionRaw Condition="'$(GitVersion_MajorMinorPatch)' != ''">$(GitVersion_MajorMinorPatch)-$(GitVersion_EscapedBranchName).$(GitVersion_PreReleaseNumber)</GitVersionRaw>
|
|
||||||
<GitVersionRaw Condition="'$(GitVersionRaw)' == ''">$(GitVersion_NuGetVersionV2)</GitVersionRaw>
|
|
||||||
<GitVersionSanitized>$([System.Text.RegularExpressions.Regex]::Replace('$(GitVersionRaw)','[{}]',''))</GitVersionSanitized>
|
|
||||||
<Version Condition="'$(GitVersionSanitized)' != ''">$(GitVersionSanitized)</Version>
|
|
||||||
<Version Condition="'$(GitVersionSanitized)' == ''">0.1.0</Version>
|
|
||||||
<PackageReleaseNotes>See Git history for release notes.</PackageReleaseNotes>
|
<PackageReleaseNotes>See Git history for release notes.</PackageReleaseNotes>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<IncludeSymbols>false</IncludeSymbols>
|
<IncludeSymbols>false</IncludeSymbols>
|
||||||
|
|
@ -27,8 +22,8 @@
|
||||||
<PackageReference Include="OpenCvSharp4" Version="4.13.0.20260214" />
|
<PackageReference Include="OpenCvSharp4" Version="4.13.0.20260214" />
|
||||||
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.13.0.20260214" />
|
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.13.0.20260214" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
|
||||||
<!-- GitVersion MSBuild integration for automatic semantic versioning -->
|
<!-- Use MinVer to infer versions from Git tags (applies at pack/build time) -->
|
||||||
<PackageReference Include="GitVersion.MsBuild" Version="6.5.1" PrivateAssets="all" />
|
<PackageReference Include="MinVer" Version="3.1.0" PrivateAssets="all" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue