Skip to content

Commit

Permalink
Fix CI/CD publishing steps (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que authored Dec 23, 2024
1 parent ab6c1b3 commit f0b1cde
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/autodiscovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery.Win32/bin/Release/Redpoint.AutoDiscovery.Win32.*.nupkg" | % { $_.FullName })
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery.Win32/bin/x86/Release/Redpoint.AutoDiscovery.Win32.*.nupkg" | % { $_.FullName })
if ($LastExitCode -ne 0) { exit $LastExitCode }
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery.Win64/bin/Release/Redpoint.AutoDiscovery.Win64.*.nupkg" | % { $_.FullName })
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery.Win64/bin/x64/Release/Redpoint.AutoDiscovery.Win64.*.nupkg" | % { $_.FullName })
if ($LastExitCode -ne 0) { exit $LastExitCode }
30 changes: 18 additions & 12 deletions .github/workflows/mac-logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,30 @@ jobs:
if ($LastExitCode -ne 0) { exit $LastExitCode }
Push-Location "Redpoint.Logging.Mac.Native"
try {
Write-Host "Building native logging libraries for macOS..."
New-Item -ItemType Directory -Path ./runtimes/osx-arm64/native/ | Out-Null
clang -dynamiclib -o "./runtimes/osx-arm64/native/libLogging.arm64.dylib" -arch arm64 "logging.c"
if ($LastExitCode -ne 0) { exit $LastExitCode }
New-Item -ItemType Directory -Path ./runtimes/osx-x64/native/ | Out-Null
clang -dynamiclib -o "./runtimes/osx-x64/native/libLogging.x64.dylib" -arch x86_64 "logging.c"
if ($LastExitCode -ne 0) { exit $LastExitCode }
Write-Host "Building native logging libraries for macOS..."
New-Item -ItemType Directory -Path ./runtimes/osx-arm64/native/ | Out-Null
clang -dynamiclib -o "./runtimes/osx-arm64/native/libLogging.arm64.dylib" -arch arm64 "logging.c"
if ($LastExitCode -ne 0) { exit $LastExitCode }
New-Item -ItemType Directory -Path ./runtimes/osx-x64/native/ | Out-Null
clang -dynamiclib -o "./runtimes/osx-x64/native/libLogging.x64.dylib" -arch x86_64 "logging.c"
if ($LastExitCode -ne 0) { exit $LastExitCode }
Write-Host "Generating NuGet package..."
Invoke-WebRequest -UseBasicParsing -OutFile nuget.exe -Uri "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
/opt/homebrew/bin/mono nuget.exe pack Redpoint.Logging.Mac.Native.nuspec -Version $PackageVersion -OutputDirectory bin
if ($LastExitCode -ne 0) { exit $LastExitCode }
} finally {
Pop-Location
}
Write-Host "Generating NuGet package..."
Invoke-WebRequest -UseBasicParsing -OutFile nuget.exe -Uri "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
/opt/homebrew/bin/mono nuget.exe pack Redpoint.Logging.Mac.Native.nuspec -Version $PackageVersion -OutputDirectory bin
if ($LastExitCode -ne 0) { exit $LastExitCode }
Write-Host "Full paths for generated NuGet packages:"
(Get-ChildItem -Path "Redpoint.Logging.Mac.Native/bin/" -Filter "Redpoint.Logging.Mac.Native.*.nupkg" | % { $_.FullName })
- name: Publish Redpoint.Logging.Mac.Native
shell: pwsh
if: github.ref == 'refs/heads/main'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "bin/Redpoint.Logging.Mac.Native.*.nupkg" | % { $_.FullName })
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Path "Redpoint.Logging.Mac.Native/bin/" -Filter "Redpoint.Logging.Mac.Native.*.nupkg" | % { $_.FullName })
if ($LastExitCode -ne 0) { exit $LastExitCode }

0 comments on commit f0b1cde

Please sign in to comment.