Skip to content

Commit 96a46b4

Browse files
committed
Added make release scripts
1 parent 21c5418 commit 96a46b4

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ vcpkg_installed/
99
build/
1010

1111
/*.log
12-
CMakeCache.txt
12+
CMakeCache.txt
13+
14+
releases/

make-release-x64-linux.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# shellcheck disable=SC2164
4+
5+
root_dir=$(pwd)
6+
releases_dir="${root_dir}/releases"
7+
version=$(cat version.txt)
8+
9+
mkdir -p "$releases_dir"
10+
11+
function build_and_archive() {
12+
local triplet=$1
13+
cmake --build .
14+
archive_name="mtsum-v${version}-${triplet}"
15+
tar -cf - "mtsum" > "${archive_name}.tar"
16+
7z a -tgzip -mx=9 "${releases_dir}/${archive_name}.tar.gz" "${archive_name}.tar"
17+
rm "${archive_name}.tar"
18+
}
19+
20+
cmake --preset release-make -DMTSUM_STATIC=OFF -DMTSUM_VCPKG=ON -B cmake-build-release-x64-linux
21+
cd cmake-build-release-x64-linux
22+
build_and_archive "x64-linux"
23+
24+
cd "$root_dir"
25+
26+
cmake --preset release-make -DMTSUM_STATIC=ON -DMTSUM_VCPKG=ON -B cmake-build-release-x64-linux-static
27+
cd cmake-build-release-x64-linux-static
28+
build_and_archive "x64-linux-static"

make-release-x64-windows.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Import-VisualStudioVars -Architecture amd64
2+
3+
$rootDir = Get-Location
4+
$releasesDir = Join-Path $rootDir "releases"
5+
$version = Get-Content "version.txt" -Raw
6+
7+
New-Item -ItemType Directory -Force -Path $releasesDir
8+
9+
function Build-And-Archive {
10+
param (
11+
[string]$triplet
12+
)
13+
cmake --build .
14+
$archiveName = "mtsum-v$version-$triplet"
15+
7z a -tzip -mx=9 "$releasesDir\$archiveName.zip" "mtsum.exe" *.dll
16+
}
17+
18+
#cmake --preset release-ninja -DMTSUM_STATIC=OFF -DMTSUM_VCPKG=ON -B cmake-build-release-x64-windows
19+
Set-Location "cmake-build-release-x64-windows"
20+
Build-And-Archive -triplet "x64-windows"
21+
22+
Set-Location $rootDir
23+
24+
#cmake --preset release-ninja -DMTSUM_STATIC=ON -DMTSUM_VCPKG=ON -B cmake-build-release-x64-windows-static
25+
Set-Location "cmake-build-release-x64-windows-static"
26+
Build-And-Archive -triplet "x64-windows-static"
27+
28+
Set-Location $rootDir

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.0

0 commit comments

Comments
 (0)