Skip to content

Commit

Permalink
added components needed for proper CI release (#38) (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Jul 12, 2019
1 parent b3b2c26 commit 12de777
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:
displayName: 'FAKE Build'
inputs:
filename: build.cmd
arguments: 'All SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(Akka.NET Tools NuGet)'
arguments: 'Nuget SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(Akka.NET Tools NuGet)'

- task: GitHubRelease@0
displayName: 'GitHub release (create)'
Expand Down
16 changes: 15 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $DotNetVersion = "2.1.500";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v$DotNetVersion/scripts/obtain/dotnet-install.ps1";
$NugetVersion = "4.1.0";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
$ProtobufVersion = "3.2.0"
$ProtobufVersion = "3.4.0"
$DocfxVersion = "2.40.5"

# Make sure tools folder exists
Expand Down Expand Up @@ -128,6 +128,20 @@ if (!(Test-Path $DocfxExePath)) {
}
}

###########################################################################
# SignTool
###########################################################################

# Make sure the SignClient has been installed
if (Get-Command signclient -ErrorAction SilentlyContinue) {
Write-Host "Found SignClient. Skipping install."
}
else{
$SignClientFolder = Join-Path $ToolPath "signclient"
Write-Host "SignClient not found. Installing to ... $SignClientFolder"
dotnet tool install SignClient --version 1.0.82 --tool-path "$SignClientFolder"
}

###########################################################################
# RUN BUILD SCRIPT
###########################################################################
Expand Down
36 changes: 35 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
# Define directories.
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
SIGNCLIENT_DIR=$TOOLS_DIR/signclient
NUGET_EXE=$TOOLS_DIR/nuget.exe
NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
FAKE_VERSION=4.61.2
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
DOTNET_VERSION=2.1.500
DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scripts/obtain/dotnet-install.sh
DOTNET_CHANNEL=LTS;
DOCFX_VERSION=2.40.5
DOCFX_EXE=$TOOLS_DIR/docfx.console/tools/docfx.exe

# Define default arguments.
TARGET="Default"
CONFIGURATION="Release"
Expand Down Expand Up @@ -46,13 +51,14 @@ if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" $DOTNET_INSTALLER_URL
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --channel $DOTNET_CHANNEL --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
chmod -R 0755 ".dotnet"
"$SCRIPT_DIR/.dotnet/dotnet" --info


###########################################################################
# INSTALL NUGET
###########################################################################
Expand Down Expand Up @@ -85,6 +91,34 @@ if [ ! -f "$FAKE_EXE" ]; then
exit 1
fi

###########################################################################
# INSTALL DOCFX
###########################################################################
if [ ! -f "$DOCFX_EXE" ]; then
mono "$NUGET_EXE" install docfx.console -ExcludeVersion -Version $DOCFX_VERSION -OutputDirectory "$TOOLS_DIR"
if [ $? -ne 0 ]; then
echo "An error occured while installing DocFx."
exit 1
fi
fi

# Make sure that DocFx has been installed.
if [ ! -f "$DOCFX_EXE" ]; then
echo "Could not find docfx.exe at '$DOCFX_EXE'."
exit 1
fi

###########################################################################
# INSTALL SignTool
###########################################################################
if [ ! -f "$SIGNTOOL_EXE" ]; then
"$SCRIPT_DIR/.dotnet/dotnet" tool install SignClient --version 1.0.82 --tool-path "$SIGNCLIENT_DIR"
if [ $? -ne 0 ]; then
echo "SignClient already installed."
fi
fi


###########################################################################
# WORKAROUND FOR MONO
###########################################################################
Expand Down

0 comments on commit 12de777

Please sign in to comment.