Skip to content

Commit

Permalink
Merge pull request #72 from Ellerbach/fix-release-pipeline
Browse files Browse the repository at this point in the history
Fix release pipeline
  • Loading branch information
mtirionMSFT authored Oct 29, 2024
2 parents 8debe6c + 2821a9f commit e76a24d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
dotnet-version: 8.x

# Loop through all the solutions in src and restore, build & test
# Skip DocFxCompanionTools.sln, as it is a combination of all solutions.
- name: Restore, build & test
shell: pwsh
run: |
foreach ($sln in (Get-ChildItem -Recurse src\*.sln)) {
foreach ($sln in (Get-ChildItem -Recurse src\*.sln -Exclude DocFxCompanionTools.sln)) {
Write-Host "Start building $($sln.FullName)"
& dotnet restore $sln.FullName
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@ on:
jobs:
build:
runs-on: windows-latest
steps:

# Checkout sources. Depth=0 is for using GitVersion
steps:
# Checkout sources. Depth=0 is for using GitVersion
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
fetch-depth: 0

# Install and Setup GitVersion
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

# Install and Setup GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Use GitVersion
versionSpec: '5.x'

# Step id is used as reference for the output values
- name: Use GitVersion to determine the version
id: gitversion
uses: gittools/actions/gitversion/[email protected]

# Setup .NET 8
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

useConfigFile: true
# Build the tools & create the zip-file and nuget packages
# Chocolatey tools are in .\tools. NuGet packages in .\artifacts
- name: Build & Package
Expand Down Expand Up @@ -74,4 +76,5 @@ jobs:
run: |
foreach($file in (Get-ChildItem "./artifacts" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_TOOLS }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
}
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if (Test-Path -Path $solution.assetZipPath) {
Remove-Item $solution.assetZipPath
}

# Build all dotnet solution into $solution.targetFolder as single exe's
foreach ($sln in (Get-ChildItem -Recurse src\*.sln)) {
# Build all dotnet projects into $solution.targetFolder as single exe's. Skip Test projects.
foreach ($sln in (Get-ChildItem -Recurse src\*\*.csproj -Exclude *.Test.*)) {
Write-Host "Start building $($sln.FullName)"
& dotnet publish $sln.FullName -c Release -r win-x64 /p:PublishSingleFile=true /p:CopyOutputSymbolsToPublishDirectory=false --self-contained false -o $solution.targetFolder
}
Expand Down

0 comments on commit e76a24d

Please sign in to comment.