From 48c47e8384b8edf9a6b37abf735b8045c1f6d783 Mon Sep 17 00:00:00 2001 From: Steven Cleve <107827476+stevencl840@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:18:36 +1100 Subject: [PATCH 1/4] Add nightly build --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- LibGit2Sharp/LibGit2Sharp.csproj | 4 ++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 321c21385..5bc1d25d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,14 @@ on: - '[0-9]+.[0-9]+.[0-9]+-*' pull_request: workflow_dispatch: + inputs: + nightly: + description: 'Build as nightly version' + required: false + type: boolean + default: false + schedule: + - cron: '0 15 * * *' # Run at 3 PM UTC (1 AM Melbourne AEST / 2 AM AEDT) env: DOTNET_NOLOGO: true jobs: @@ -23,7 +31,22 @@ jobs: with: dotnet-version: 9.0.x - name: Build - run: dotnet build LibGit2Sharp.sln --configuration Release + run: | + # if it is a pull request build set the build identity to branchname.runnumber + if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") { + $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', '' + $buildIdentity = "$branchName.${{ github.run_number }}" + + $env:BUILD_IDENTITY = $buildIdentity + } + + # if it is a scheduled build set the build identity to nightly + if ("${{ github.event_name }}" -eq "schedule" -or "${{ inputs.nightly }}" -eq "true") { + $env:BUILD_IDENTITY = "nightly.${{ github.run_number }}" + } + + dotnet build LibGit2Sharp.sln --configuration Release + shell: pwsh - name: Upload packages uses: actions/upload-artifact@v4.3.1 with: @@ -105,7 +128,7 @@ jobs: name: Octopus NuGet Push needs: [build, test, test-linux] # && github.ref == 'refs/heads/octopus/master' - if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule' + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' runs-on: ubuntu-22.04 steps: - uses: actions/download-artifact@v4 diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index f3ae850d4..5305e7e2f 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -29,6 +29,10 @@ true + + octopus-$(BUILD_IDENTITY) + + From 3de21f6c4ffead9dbdd7273a2db580fdfb907fde Mon Sep 17 00:00:00 2001 From: Steven Cleve <107827476+stevencl840@users.noreply.github.com> Date: Fri, 19 Dec 2025 08:26:44 +1100 Subject: [PATCH 2/4] Remove nigtly flag --- .github/workflows/ci.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bc1d25d7..6f744467b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,12 +7,6 @@ on: - '[0-9]+.[0-9]+.[0-9]+-*' pull_request: workflow_dispatch: - inputs: - nightly: - description: 'Build as nightly version' - required: false - type: boolean - default: false schedule: - cron: '0 15 * * *' # Run at 3 PM UTC (1 AM Melbourne AEST / 2 AM AEDT) env: @@ -35,13 +29,12 @@ jobs: # if it is a pull request build set the build identity to branchname.runnumber if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") { $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', '' - $buildIdentity = "$branchName.${{ github.run_number }}" - $env:BUILD_IDENTITY = $buildIdentity + $env:BUILD_IDENTITY = "$branchName.${{ github.run_number }}" } # if it is a scheduled build set the build identity to nightly - if ("${{ github.event_name }}" -eq "schedule" -or "${{ inputs.nightly }}" -eq "true") { + if ("${{ github.event_name }}" -eq "schedule") { $env:BUILD_IDENTITY = "nightly.${{ github.run_number }}" } From 4414d724689536329ef298dc826186cd7a980f1d Mon Sep 17 00:00:00 2001 From: Steven Cleve <107827476+stevencl840@users.noreply.github.com> Date: Fri, 19 Dec 2025 08:35:54 +1100 Subject: [PATCH 3/4] One last try --- LibGit2Sharp/LibGit2Sharp.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 5305e7e2f..cbb05e648 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -31,6 +31,7 @@ octopus-$(BUILD_IDENTITY) + true From 4f195c6efde0844dff740c7d63f6e8dd8a8d032b Mon Sep 17 00:00:00 2001 From: Steven Cleve <107827476+stevencl840@users.noreply.github.com> Date: Fri, 19 Dec 2025 08:45:41 +1100 Subject: [PATCH 4/4] Revert --- LibGit2Sharp/LibGit2Sharp.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index cbb05e648..5305e7e2f 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -31,7 +31,6 @@ octopus-$(BUILD_IDENTITY) - true