Skip to content

Commit

Permalink
ci: add archives for each library to GitHub release (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit authored Aug 29, 2023
1 parent a35d48c commit dd3ec9b
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
Set-PSDebug -Trace 1
$RunId = '${{ github.event.inputs.run_id }}'
if ($RunId -eq 'latest') {
$RunId = $(gh run list -w 'build' --json 'status,databaseId,conclusion') |
Expand All @@ -48,7 +50,7 @@ jobs:
}
New-Item -Path "package" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
Set-Location "package"
Push-Location "package"
Write-Host "Downloading run $RunId"
& gh run download $RunId -n 'cadeau-nupkg'
Expand All @@ -69,12 +71,35 @@ jobs:
}
Compress-Archive -Path ".\$NugetName\*" -DestinationPath $NupkgFile -CompressionLevel Optimal
- name: Package shared libraries as archives
shell: pwsh
working-directory: package
run: |
Set-PSDebug -Trace 1
$NupkgFile = Get-Item .\Devolutions.Cadeau.*.nupkg
$NugetName = $NupkgFile.BaseName
Get-Item -Path ".\$NugetName\runtimes\*" | ForEach-Object {
$LibFile = Get-Item -Path "$($_.FullName)\native\*xmf*"
$ArchiveName = "cadeau-$($_.Name).zip"
Compress-Archive -Path $LibFile -DestinationPath $ArchiveName -CompressionLevel Optimal
}
- name: Clean
shell: pwsh
working-directory: package
run: |
Set-PSDebug -Trace 1
$NupkgFile = Get-Item .\Devolutions.Cadeau.*.nupkg
$NugetName = $NupkgFile.BaseName
Remove-Item ".\$NugetName" -Recurse
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: cadeau-nupkg
name: cadeau-libs
path: package/*

publish:
Expand All @@ -88,7 +113,7 @@ jobs:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: cadeau-nupkg
name: cadeau-libs
path: package

- name: Publish to nuget.org
Expand Down

0 comments on commit dd3ec9b

Please sign in to comment.