Only pack PDBs on master and tags to reduce AppVeyor artifacts size

This commit is contained in:
Mike Gelfand
2021-10-17 14:04:18 +03:00
parent 08996ab4c7
commit de7b7a284c
3 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ for:
- pwsh: |
$Version = git describe --tags --abbrev=10 --always
if ($Version -ne $Env:APPVEYOR_REPO_BRANCH) {
$version += "-${Env:APPVEYOR_REPO_BRANCH}"
$Version += "-${Env:APPVEYOR_REPO_BRANCH}"
}
$BuildIndex = 0
@@ -63,7 +63,7 @@ for:
& (Join-Path $Env:APPVEYOR_BUILD_FOLDER release windows main.ps1) `
-Mode Build `
-BuildArch $env:TR_ARCH `
-NoPackDebugSyms:$($Env:APPVEYOR_REPO_BRANCH -match "/")
-PackDebugSyms:$($Env:APPVEYOR_REPO_BRANCH -eq "master" -or $Env:APPVEYOR_REPO_TAG -eq "true")
} catch {
Write-Error ("{1}{0}{2}{0}{3}" -f [Environment]::NewLine, $_.ToString(), $_.InvocationInfo.PositionMessage, $_.ScriptStackTrace) -ErrorAction Continue
exit 1

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env pwsh
function global:Build-Transmission([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir, [string] $SourceDir, [string] $ArtifactsDir, [boolean] $NoPackDebugSyms) {
function global:Build-Transmission([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir, [string] $SourceDir, [string] $ArtifactsDir, [boolean] $PackDebugSyms) {
$BuildDir = Join-Path $SourceDir .build
$env:PATH = @(
@@ -65,7 +65,7 @@ function global:Build-Transmission([string] $PrefixDir, [string] $Arch, [string]
$MsiPackage = (Get-ChildItem (Join-Path $BuildDir dist msi 'transmission-*.msi'))[0]
Move-Item -Path $MsiPackage.FullName -Destination $ArtifactsDir
if (-not $NoPackDebugSyms) {
if ($PackDebugSyms) {
Invoke-NativeCommand cmake -E chdir $DebugSymbolsDir 7z a -y (Join-Path $ArtifactsDir "$($MsiPackage.BaseName)-pdb.7z")
}
}

View File

@@ -19,7 +19,7 @@ Param(
[string] $ScriptBaseUrl,
[Parameter()]
[switch] $NoPackDebugSyms
[switch] $PackDebugSyms
)
Set-StrictMode -Version '6.0'
@@ -250,7 +250,7 @@ if ($Mode -eq 'Build') {
Invoke-Build Curl
Invoke-Build Qt
Invoke-Build Transmission -NoCache -MoreArguments @($SourceDir, $SourceDir, $NoPackDebugSyms.IsPresent)
Invoke-Build Transmission -NoCache -MoreArguments @($SourceDir, $SourceDir, $PackDebugSyms.IsPresent)
}
if ($Mode -eq 'Test') {