Skip to content

Commit 1389d4b

Browse files
committed
Repack the distribution on CI
To avoid GitHub packing it again (see actions/upload-artifact#39).
1 parent ab5d21d commit 1389d4b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ jobs:
7070
run: |
7171
$version = ./scripts/Get-Version.ps1
7272
Write-Output "::set-env name=AVALONIA_RIDER_VERSION::$version"
73+
- name: Unpack Distribution # for the purpose of uploading
74+
if: matrix.image == 'ubuntu-18.04'
75+
shell: pwsh
76+
run: scripts/Unpack-Distribution.ps1
7377
- name: Upload Distribution
7478
if: matrix.image == 'ubuntu-18.04'
7579
uses: actions/upload-artifact@v2
7680
with:
7781
name: avaloniarider-${{ env.AVALONIA_RIDER_VERSION }}
78-
path: build/distributions/avaloniarider-${{ env.AVALONIA_RIDER_VERSION }}.zip
82+
path: build/distributions/unpacked
7983

8084
# Finalize
8185
- name: Stop Gradle Daemon # to collect Gradle cache

scripts/Unpack-Distribution.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<#
2+
.SYNOPSIS
3+
The purpose of this script is to unpack the compressed plugin artifact.
4+
5+
It is used during CI builds to generate the layout for uploading.
6+
.PARAMETER DistributionsLocation
7+
Path to the directory containing compressed plugin distribution.
8+
#>
9+
param (
10+
[string] $DistributionsLocation = "$PSScriptRoot/../build/distributions"
11+
)
12+
13+
$file = Get-Item $DistributionsLocation/*
14+
if (!$file) {
15+
throw "File not found in $DistributionsLocation"
16+
}
17+
if ($file.Count -gt 1) {
18+
throw "Found more files than expected in ${DistributionsLocation}: $($file.Count)"
19+
}
20+
21+
Expand-Archive -Path $file -DestinationPath $DistributionsLocation/unpacked

0 commit comments

Comments
 (0)