Skip to content

Commit

Permalink
try and fix nugetpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Dec 18, 2024
1 parent b6f3316 commit 01fca73
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 30 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,13 @@ jobs:
dotnet tool restore
- name: 🔨 Use GitVersion
id: gitversion
shell: bash
shell: pwsh
run: |
function Camelize($key) {
return -join ($key -split '_') | ForEach-Object { $_.Substring(0,1).ToUpper() + $_.Substring(1) }
}
$data = dotnet gitversion | ConvertFrom-Json
foreach ($item in $data.PSObject.Properties) {
$key = $item.Name
$value = $item.Value
$camelizedKey = Camelize $key
echo "$camelizedKey=$value" >> $env:GITHUB_OUTPUT
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
}
- name: Create Milestone
env:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,13 @@ jobs:
dotnet tool restore
- name: 🔨 Use GitVersion
id: gitversion
shell: bash
shell: pwsh
run: |
function Camelize($key) {
return -join ($key -split '_') | ForEach-Object { $_.Substring(0,1).ToUpper() + $_.Substring(1) }
}
$data = dotnet gitversion | ConvertFrom-Json
foreach ($item in $data.PSObject.Properties) {
$key = $item.Name
$value = $item.Value
$camelizedKey = Camelize $key
echo "$camelizedKey=$value" >> $env:GITHUB_OUTPUT
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
}
- name: Create Milestone
env:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/update-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ jobs:
dotnet tool restore
- name: 🔨 Use GitVersion
id: gitversion
shell: bash
shell: pwsh
run: |
function Camelize($key) {
return -join ($key -split '_') | ForEach-Object { $_.Substring(0,1).ToUpper() + $_.Substring(1) }
}
$data = dotnet gitversion | ConvertFrom-Json
foreach ($item in $data.PSObject.Properties) {
$key = $item.Name
$value = $item.Value
$camelizedKey = Camelize $key
echo "$camelizedKey=$value" >> $env:GITHUB_OUTPUT
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
}
- name: Create Milestone
env:
Expand Down
19 changes: 7 additions & 12 deletions src/Nuke/Jobs/WorkflowHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ params IEnumerable<BaseGitHubActionsStep> steps
)
{
return new(name)
{
RunsOn = ( !attribute.IsGithubHosted ) ? attribute.Images : [],
Matrix = ( attribute.IsGithubHosted ) ? attribute.Images : [],
Steps =
{
RunsOn = ( !attribute.IsGithubHosted ) ? attribute.Images : [],
Matrix = ( attribute.IsGithubHosted ) ? attribute.Images : [],
Steps =
[
new CheckoutStep("Checkout")
{
Expand All @@ -48,7 +48,7 @@ params IEnumerable<BaseGitHubActionsStep> steps
},
..steps
]
};
};
}

/// <summary>
Expand Down Expand Up @@ -151,18 +151,13 @@ public static IEnumerable<BaseGitHubActionsStep> RunGitVersion(GithubActionCondi
new("versionSourceSha"),
new("weightedPreReleaseNumber"),
],
Shell = "bash",
Shell = "pwsh",
Run = """
function Camelize($key) {
return -join ($key -split '_') | ForEach-Object { $_.Substring(0,1).ToUpper() + $_.Substring(1) }
}
$data = dotnet gitversion | ConvertFrom-Json
foreach ($item in $data.PSObject.Properties) {
$key = $item.Name
$value = $item.Value
$camelizedKey = Camelize $key
echo "$camelizedKey=$value" >> $env:GITHUB_OUTPUT
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
}
"""
};
Expand Down

0 comments on commit 01fca73

Please sign in to comment.