Skip to content
Draft
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
34 changes: 26 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,16 @@ jobs:
echo "${{ github.ref }}"
$tagVersion = "${{ github.ref }}".substring(11)
if ("${{ github.event_name }}" -eq "schedule") {
$tagVersion = & git describe --tags --abbrev=0
# Remove 'v' or 'V' prefix if present for NuGet version compatibility
if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) {
$tagVersion = $tagVersion.Substring(1)
$latestTag = & git describe --tags --abbrev=0 2>&1
if ($LASTEXITCODE -eq 0) {
$tagVersion = $latestTag
# Remove 'v' or 'V' prefix if present for NuGet version compatibility
if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) {
$tagVersion = $tagVersion.Substring(1)
}
} else {
Write-Host "No tags found, using fallback version"
$tagVersion = "0.0.1"
}
$tagVersion = "$tagVersion-${{ github.run_number }}"
}
Expand Down Expand Up @@ -115,6 +121,12 @@ jobs:
name: Push NuGets

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
Expand All @@ -124,10 +136,16 @@ jobs:
run: |
$tagVersion = "${{ github.ref }}".substring(11)
if ( "${{ github.event_name }}" -eq "schedule" -or "${{ github.event_name }}" -eq "push" ) {
$tagVersion = & git describe --tags --abbrev=0
# Remove 'v' or 'V' prefix if present for NuGet version compatibility
if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) {
$tagVersion = $tagVersion.Substring(1)
$latestTag = & git describe --tags --abbrev=0 2>&1
if ($LASTEXITCODE -eq 0) {
$tagVersion = $latestTag
# Remove 'v' or 'V' prefix if present for NuGet version compatibility
if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) {
$tagVersion = $tagVersion.Substring(1)
}
} else {
Write-Host "No tags found, using fallback version"
$tagVersion = "0.0.1"
}
$tagVersion = "$tagVersion-${{ github.run_number }}"
}
Expand Down