Skip to content

Commit

Permalink
create Linux packages from package-distribution.ps1 (microsoft#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfurt authored Jun 14, 2021
1 parent e2ebcfc commit 4113531
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .azure/templates/build-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ jobs:
arch: universal
tls: openssl

- task: PowerShell@2
displayName: Prepare Build Machine
inputs:
pwsh: true
filePath: scripts/prepare-machine.ps1
arguments: -Configuration Build

- task: PowerShell@2
displayName: Package Distribution
inputs:
Expand Down
24 changes: 22 additions & 2 deletions scripts/make-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,31 @@ if [ ! -e "$ARTIFACTS/libmsquic.so" ]; then
exit 1
fi
OUTPUT="artifacts/packages/${OS}/${ARCH}_${CONFIG}_openssl"

# process arguments and allow to override default values
while :; do
if [ $# -le 0 ]; then
break
fi

case $1 in
-o|--output)
shift
OUTPUT=$1
;;
*)
echo unknown argument
;;
esac

shift
done

mkdir -p ${OUTPUT}

# RedHat/CentOS
fpm -f -s dir -t rpm -n libmsquic -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
--package "$OUTPUT" \
--package "$OUTPUT" --log error \
"$ARTIFACTS/libmsquic.so"=/usr/${LIBDIR}/libmsquic.so \
"$ARTIFACTS/libmsquic.lttng.so"=/usr/${LIBDIR}/libmsquic.lttng.so

Expand All @@ -46,6 +66,6 @@ if [ "$LIBDIR" == 'lib64' ]; then
LIBDIR="lib/x86_64-linux-gnu"
fi
fpm -f -s dir -t deb -n libmsquic -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
--package "$OUTPUT" \
--package "$OUTPUT" --log error \
"$ARTIFACTS/libmsquic.so"=/usr/${LIBDIR}/libmsquic.so \
"$ARTIFACTS/libmsquic.lttng.so"=/usr/${LIBDIR}/libmsquic.lttng.so
6 changes: 6 additions & 0 deletions scripts/package-distribution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,10 @@ foreach ($Build in $AllBuilds) {
}
# Package zip archive
Compress-Archive -Path "$TempDir/*" -DestinationPath (Join-Path $DistDir "msquic_$($Platform)_$BuildBaseName.zip") -Force

# For now, package only x64 Release binaries
if ($Platform -eq "linux" -and $BuildBaseName.Contains("x64_Release")) {
Write-Output "Packaging $Build"
scripts/make-packages.sh --output $DistDir
}
}
3 changes: 3 additions & 0 deletions scripts/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ if ($IsWindows) {
sudo apt-get install -y liblttng-ust-dev
# only used for the codecheck CI run:
sudo apt-get install -y cppcheck clang-tidy
# used for packaging
sudo apt-get install -y ruby ruby-dev rpm
sudo gem install fpm
}
"Test" {
sudo apt-add-repository ppa:lttng/stable-2.12
Expand Down

0 comments on commit 4113531

Please sign in to comment.