fix: Fixes publish on Linux with non-bash terminals (#1802)
This commit is contained in:
parent
96a398784f
commit
84c68bf73c
3 changed files with 48 additions and 46 deletions
2
.github/workflows/build-test.yml
vendored
2
.github/workflows/build-test.yml
vendored
|
|
@ -94,6 +94,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.0.x
|
dotnet-version: 8.0.x
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./publish.sh Release
|
run: ./publish.cmd Release
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test --no-restore
|
run: dotnet test --no-restore
|
||||||
|
|
|
||||||
47
publish.cmd
47
publish.cmd
|
|
@ -3,53 +3,12 @@
|
||||||
GOTO :CMDSCRIPT
|
GOTO :CMDSCRIPT
|
||||||
|
|
||||||
::SHELLSCRIPT
|
::SHELLSCRIPT
|
||||||
config=$1
|
path=$(dirname "$0")
|
||||||
os=$2
|
cd $path
|
||||||
arch=${3:-$(uname -m)}
|
./publish.sh
|
||||||
|
|
||||||
if [[ -n $os ]]; then
|
|
||||||
os="-r $os"
|
|
||||||
elif [[ $(uname) = "Darwin" ]]; then
|
|
||||||
os="-r osx"
|
|
||||||
else
|
|
||||||
os="-r linux"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $config ]]; then
|
|
||||||
config="$(tr '[:lower:]' '[:upper:]' <<< ${1:0:1})${1:1}"
|
|
||||||
config="-c $config"
|
|
||||||
else
|
|
||||||
config="-c Release"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $arch == *'aarch'* || $arch == *'arm'* ]]; then
|
|
||||||
arch="arm64"
|
|
||||||
else
|
|
||||||
arch="x64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $os == *'centos'* || $os == *'rhel'* ]]; then
|
|
||||||
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo dotnet tool restore
|
|
||||||
dotnet tool restore
|
|
||||||
|
|
||||||
echo dotnet clean --verbosity quiet
|
|
||||||
dotnet clean --verbosity quiet
|
|
||||||
echo dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json
|
|
||||||
dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json
|
|
||||||
|
|
||||||
echo dotnet publish ${config} ${os}-${arch} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj
|
|
||||||
dotnet publish ${config} ${os}-${arch} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj
|
|
||||||
|
|
||||||
echo Generating serialization migration schema...
|
|
||||||
dotnet tool run ModernUOSchemaGenerator -- ModernUO.sln
|
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
:CMDSCRIPT
|
:CMDSCRIPT
|
||||||
|
|
||||||
IF "%~1" == "" (
|
IF "%~1" == "" (
|
||||||
SET config=-c Release
|
SET config=-c Release
|
||||||
) ELSE (
|
) ELSE (
|
||||||
|
|
|
||||||
45
publish.sh
45
publish.sh
|
|
@ -1,2 +1,45 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
./publish.cmd "$@"
|
config=$1
|
||||||
|
os=$2
|
||||||
|
arch=${3:-$(uname -m)}
|
||||||
|
|
||||||
|
if [[ -n $os ]]; then
|
||||||
|
os="-r $os"
|
||||||
|
elif [[ $(uname) = "Darwin" ]]; then
|
||||||
|
os="-r osx"
|
||||||
|
else
|
||||||
|
os="-r linux"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $config ]]; then
|
||||||
|
config="$(tr '[:lower:]' '[:upper:]' <<< ${1:0:1})${1:1}"
|
||||||
|
config="-c $config"
|
||||||
|
else
|
||||||
|
config="-c Release"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $arch == *'aarch'* || $arch == *'arm'* ]]; then
|
||||||
|
arch="arm64"
|
||||||
|
else
|
||||||
|
arch="x64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $os == *'centos'* || $os == *'rhel'* ]]; then
|
||||||
|
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo dotnet tool restore
|
||||||
|
dotnet tool restore
|
||||||
|
|
||||||
|
echo dotnet clean --verbosity quiet
|
||||||
|
dotnet clean --verbosity quiet
|
||||||
|
echo dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json
|
||||||
|
dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json
|
||||||
|
|
||||||
|
echo dotnet publish ${config} ${os}-${arch} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj
|
||||||
|
dotnet publish ${config} ${os}-${arch} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj
|
||||||
|
|
||||||
|
echo Generating serialization migration schema...
|
||||||
|
dotnet tool run ModernUOSchemaGenerator -- ModernUO.sln
|
||||||
|
|
||||||
|
exit $?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue