Skip to content

Commit 0dc0d67

Browse files
authored
Merge pull request #1421 from asarium/build/releaseSources
Build a compressed package of the source as part of a release
2 parents 1743e5f + 0edb360 commit 0dc0d67

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

ci/appveyor/build.ps1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class BuildConfig {
44
[string]$PackageType
55
[string]$Toolset
66
[string]$SimdType
7+
[Bool]$SourcePackage
78
}
89

910
$NightlyConfigurations = @(
@@ -12,12 +13,14 @@ $NightlyConfigurations = @(
1213
PackageType="Win64";
1314
Toolset="v140_xp";
1415
SimdType="SSE2";
16+
SourcePackage=$false;
1517
},
1618
[BuildConfig]@{
1719
Generator="Visual Studio 14 2015";
1820
PackageType="Win32";
1921
Toolset="v140_xp";
2022
SimdType="SSE2";
23+
SourcePackage=$false;
2124
}
2225
)
2326
$ReleaseConfigurations = @(
@@ -26,24 +29,28 @@ $ReleaseConfigurations = @(
2629
PackageType="Win32";
2730
Toolset="v140_xp";
2831
SimdType="SSE2";
32+
SourcePackage=$true;
2933
}
3034
[BuildConfig]@{
3135
Generator="Visual Studio 14 2015";
3236
PackageType="Win32-AVX";
3337
Toolset="v140_xp";
3438
SimdType="AVX";
39+
SourcePackage=$false;
3540
}
3641
[BuildConfig]@{
3742
Generator="Visual Studio 14 2015 Win64";
3843
PackageType="Win64";
3944
Toolset="v140_xp";
4045
SimdType="SSE2";
46+
SourcePackage=$false;
4147
}
4248
[BuildConfig]@{
4349
Generator="Visual Studio 14 2015 Win64";
4450
PackageType="Win64-AVX";
4551
Toolset="v140_xp";
4652
SimdType="AVX";
53+
SourcePackage=$false;
4754
}
4855
)
4956

@@ -54,14 +61,18 @@ $ReleaseBuild = $false
5461
$NightlyBuild = $false
5562
$DeployBuild = $false
5663

57-
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)")) {
64+
# Set to true to test either the release or the nightly part of this script
65+
$ReleaseTest = $false
66+
$NightlyTest = $false
67+
68+
if ($ReleaseTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)"))) {
5869
# Tag matches
5970
$ReleaseBuild = $true
6071
$PackageName = "fs2_open_$($matches[1])"
6172
$BuildConfigurations = $ReleaseConfigurations
6273
}
6374

64-
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)")) {
75+
if ($NightlyTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)"))) {
6576
# Tag matches
6677
$NightlyBuild = $true
6778
$PackageName = "nightly_$($matches[1])"
@@ -94,6 +105,11 @@ if ($DeployBuild) {
94105
}
95106

96107
$buildConfig = $BuildConfigurations[$buildID]
108+
109+
if ($buildConfig.SourcePackage -eq $True) {
110+
7z a -xr'!.git' "$($PackageName)-source-Win.zip" "$env:APPVEYOR_BUILD_FOLDER"
111+
Push-AppveyorArtifact "$($PackageName)-source-Win.zip"
112+
}
97113

98114
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
99115
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$($buildConfig.SimdType)" `

ci/travis/release.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ set -ex
44
mkdir -p /tmp/builds
55

66
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
7+
PARENT_DIR="$(basename $PWD)"
8+
(cd .. && tar cvf /tmp/builds/$PACKAGE_NAME-source-Unix.tar.gz --exclude-vcs "$PARENT_DIR")
9+
710
cd build
811
for config in $BUILD_CONFIGS
912
do

0 commit comments

Comments
 (0)