From dd3ec9b5f5495f5cb3e690cf093a78f242dc8900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Cortier?= Date: Tue, 29 Aug 2023 13:49:25 -0400 Subject: [PATCH] ci: add archives for each library to GitHub release (#40) --- .github/workflows/release.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f0bd2b..0c66b4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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') | @@ -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' @@ -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: @@ -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