Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set runtime variable arch dependant #1526

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions install-dpkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

set -e

if dpkg -s "gcm" &> /dev/null; then
echo "GCM already installed, nothing to do."
exit 1
fi

if [ "$EUID" -ne 0 ]; then
echo "This script must be run with sudo."
exit 1
fi

base_path=$(pwd)
linux_packaging_path="$base_path/src/linux/Packaging.Linux"

This comment was marked as off-topic.

linux_out_packaging_debug_path="$base_path/out/linux/Packaging.Linux/Debug"
version="2.4.1"

arch=$(uname -m)

if [[ "$arch" == arm64* || "$arch" == aarch64 ]]; then
out_arch="arm64"
else
out_arch="amd64"
fi

echo "Install dependencies"
apt install -y dotnet-sdk-7.0 dpkg-dev

echo "Run layout script"
sudo -u "$SUDO_USER" "$linux_packaging_path/layout.sh"

echo "Run pack script"
sudo -u "$SUDO_USER" "$linux_packaging_path/pack.sh" "--version=$version" "--payload=$linux_out_packaging_debug_path/payload" "--symbols=$linux_out_packaging_debug_path/payload.sym"

echo "Install GCM"
dpkg -i "$linux_out_packaging_debug_path/deb/gcm-linux_$out_arch.$version.deb"

if [[ "$(sudo -u "$SUDO_USER" git config --global credential.helper)" != "manager" ]]; then
echo "Configure Git to use GCM"
sudo -u "$SUDO_USER" git config --global credential.helper manager
fi
9 changes: 8 additions & 1 deletion src/linux/Packaging.Linux/layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ PROJ_OUT="$OUT/linux/Packaging.Linux"

# Build parameters
FRAMEWORK=net7.0
RUNTIME=linux-x64

arch=$(uname -m)

if [[ "$arch" == arm64* || "$arch" == aarch64 ]]; then
RUNTIME=linux-arm64
else
RUNTIME=linux-x64
fi

# Perform pre-execution checks
CONFIGURATION="${CONFIGURATION:=Debug}"
Expand Down