Skip to content

Commit 3810730

Browse files
committed
More
1 parent 31aa101 commit 3810730

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,19 @@ jobs:
3232
dotnet-version: 9.0.x
3333
- name: Build
3434
run: |
35+
# if it is a pull request build set the build identity to branchname.runnumber
3536
if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
3637
$branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
37-
$preReleaseId = "$branchName.${{ github.run_number }}"
38+
$buildIdentity = "$branchName.${{ github.run_number }}"
3839
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
40+
$env:BUILD_IDENTITY = $buildIdentity
4241
}
4342
43+
# if it is a scheduled build set the build identity to nightly
44+
if ("${{ github.event_name }}" -eq "schedule" -or ${{ inputs.nightly }}) {
45+
$env:BUILD_IDENTITY = "nightly.${{ github.run_number }}"
46+
}
47+
4448
dotnet build LibGit2Sharp.sln --configuration Release
4549
shell: pwsh
4650
- name: Show version
@@ -134,17 +138,8 @@ jobs:
134138
- uses: actions/download-artifact@v4
135139
with:
136140
path: staging
137-
- name: Push package to feed 🐙 (nightly)
138-
if: github.event_name == 'schedule' || inputs.nightly
139-
id: push-feed-nightly
140-
shell: bash
141-
env:
142-
FEED_API_KEY: ${{ secrets.FEED_API_KEY }}
143-
FEED_SOURCE: ${{ secrets.FEED_SOURCE }}
144-
run: dotnet nuget push staging/**/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" --skip-duplicate
145141
- name: Push package to feed 🐙 (regular)
146-
if: github.event_name != 'schedule' && !inputs.nightly
147-
id: push-feed-regular
142+
id: push-feed
148143
shell: bash
149144
env:
150145
FEED_API_KEY: ${{ secrets.FEED_API_KEY }}

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,17 @@
2121
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2222
<PackageId>Octopus.LibGit2Sharp</PackageId>
2323
<PackageOutputPath>$(ArtifactsPath)\package</PackageOutputPath>
24-
<MinVerDefaultPreReleaseIdentifiers>octopus-sjc-test-1234</MinVerDefaultPreReleaseIdentifiers>
24+
<MinVerDefaultPreReleaseIdentifiers>octopus.0</MinVerDefaultPreReleaseIdentifiers>
2525
<MinVerBuildMetadata Condition="'$(libgit2_hash)' != ''">libgit2-$(libgit2_hash.Substring(0,7))</MinVerBuildMetadata>
2626
</PropertyGroup>
27-
27+
2828
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
2929
<IsTrimmable>true</IsTrimmable>
3030
</PropertyGroup>
31-
32-
<!-- <PropertyGroup Condition="'$(IS_BRANCH_BUILD)' == ''">
33-
<MinVerDefaultPreReleaseIdentifiers>octopus.0</MinVerDefaultPreReleaseIdentifiers>
34-
</PropertyGroup>
35-
36-
<PropertyGroup Condition="'$(IS_BRANCH_BUILD)' != ''">
37-
38-
</PropertyGroup> -->
31+
32+
<PropertyGroup Condition="'$(BUILD_IDENTITY)' != ''">
33+
<MinVerDefaultPreReleaseIdentifiers>octopus-$(BUILD_IDENTITY)</MinVerDefaultPreReleaseIdentifiers>
34+
</PropertyGroup>
3935

4036
<ItemGroup>
4137
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.323]" PrivateAssets="none" />

0 commit comments

Comments
 (0)