Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-nugetlibrary-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
secrets: inherit
with:
ref: ${{ inputs.ref }}
branch: ${{ inputs.branch }}

build-nugetlibrary:
name: Build NuGet library project job
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-release-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
secrets: inherit
with:
ref: ${{ inputs.ref }}
branch: ${{ inputs.branch }}

# Entry gate: validate branch<->version consistency once, before the build jobs, so an NBGV mis-classification fails
# fast instead of after building and publishing. main must be a public release (no prerelease '-'); every other branch
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/get-version-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
required: false
type: string
default: ''
# Logical branch NBGV classifies public-vs-prerelease against. With IGNORE_GITHUB_REF, NBGV reads the
# checked-out git branch; callers that check out a pinned commit (detached HEAD - the build jobs) pass this
# so a local branch can be created at that commit, giving NBGV the right name. Empty leaves the checkout as-is.
branch:
required: false
type: string
default: ''
outputs:
SemVer2:
value: ${{ jobs.get-version.outputs.SemVer2 }}
Expand Down Expand Up @@ -47,6 +54,16 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0

# NBGV (with IGNORE_GITHUB_REF) classifies public-vs-prerelease from the checked-out branch. A pinned-SHA
# checkout is detached HEAD, where NBGV sees no branch and treats every leg as prerelease (the main leg would
# then build a prerelease package mismatching its clean release tag). Force a local branch at HEAD matching the
# logical branch so NBGV sees the right name while still versioning the intended commit.
- name: Pin logical branch step
if: ${{ inputs.branch != '' }}
env:
BRANCH: ${{ inputs.branch }}
run: git checkout -B "$BRANCH"

# nbgv is floated on @master: its tag stream lags master, so Dependabot tag-tracking would propose a downgrade.
# Revisit if dotnet/nbgv resumes regular tagged releases.
- name: Run Nerdbank.GitVersioning tool step
Expand Down