Skip to content

Commit f80fde3

Browse files
committed
Clean up
1 parent ee253e8 commit f80fde3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,12 @@ jobs:
3333
- name: Build
3434
run: |
3535
if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
36-
$gitDescribe = git describe --tags --abbrev=0 2>$null
37-
# Extract the base version number if it exists, if not don't override
38-
if ($gitDescribe -match '^v?(\d+\.\d+\.\d+)') {
39-
$baseVersion = $matches[1]
40-
41-
$branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
42-
$version = "$baseVersion-octopus-$branchName.${{ github.run_number }}"
43-
44-
Write-Host "PR build - overriding version to: $version"
45-
$env:MINVERVERSIONOVERRIDE = $version
46-
}
36+
$branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
37+
$preReleaseId = "$branchName.${{ github.run_number }}"
38+
39+
Write-Host "PR build - setting pre-release identifiers to: $preReleaseId (height ignored)"
40+
$env:IS_BRANCH_BUILD = "true"
41+
$env:BRANCH_PRE_RELEASE_ID = $preReleaseId
4742
}
4843
4944
dotnet build LibGit2Sharp.sln --configuration Release

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<IsTrimmable>true</IsTrimmable>
3030
</PropertyGroup>
3131

32+
<PropertyGroup Condition="'$(IS_BRANCH_BUILD)' == 'true'">
33+
<MinVerDefaultPreReleaseIdentifiers>octopus-$(BRANCH_PRE_RELEASE_ID)</MinVerDefaultPreReleaseIdentifiers>
34+
<MinVerIgnoreHeight>true</MinVerIgnoreHeight>
35+
</PropertyGroup>
36+
3237
<ItemGroup>
3338
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.323]" PrivateAssets="none" />
3439
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="all" />

0 commit comments

Comments
 (0)