Skip to content

Commit

Permalink
Repack the distribution on CI
Browse files Browse the repository at this point in the history
To avoid GitHub packing it again (see
actions/upload-artifact#39).
  • Loading branch information
ForNeVeR committed Aug 8, 2020
1 parent ab5d21d commit 1389d4b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ jobs:
run: |
$version = ./scripts/Get-Version.ps1
Write-Output "::set-env name=AVALONIA_RIDER_VERSION::$version"
- name: Unpack Distribution # for the purpose of uploading
if: matrix.image == 'ubuntu-18.04'
shell: pwsh
run: scripts/Unpack-Distribution.ps1
- name: Upload Distribution
if: matrix.image == 'ubuntu-18.04'
uses: actions/upload-artifact@v2
with:
name: avaloniarider-${{ env.AVALONIA_RIDER_VERSION }}
path: build/distributions/avaloniarider-${{ env.AVALONIA_RIDER_VERSION }}.zip
path: build/distributions/unpacked

# Finalize
- name: Stop Gradle Daemon # to collect Gradle cache
Expand Down
21 changes: 21 additions & 0 deletions scripts/Unpack-Distribution.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<#
.SYNOPSIS
The purpose of this script is to unpack the compressed plugin artifact.
It is used during CI builds to generate the layout for uploading.
.PARAMETER DistributionsLocation
Path to the directory containing compressed plugin distribution.
#>
param (
[string] $DistributionsLocation = "$PSScriptRoot/../build/distributions"
)

$file = Get-Item $DistributionsLocation/*
if (!$file) {
throw "File not found in $DistributionsLocation"
}
if ($file.Count -gt 1) {
throw "Found more files than expected in ${DistributionsLocation}: $($file.Count)"
}

Expand-Archive -Path $file -DestinationPath $DistributionsLocation/unpacked

0 comments on commit 1389d4b

Please sign in to comment.