forked from mongodb/mongo-csharp-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSHARP-4765: CI script to generate Driver's dev-package (mongodb#1169)
- Loading branch information
1 parent
927c445
commit cb90413
Showing
12 changed files
with
224 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,5 +187,6 @@ indent_size = 2 | |
# Shell scripts | ||
[*.sh] | ||
end_of_line = lf | ||
indent_size = 2 | ||
[*.{cmd, bat}] | ||
end_of_line = crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ src/packages | |
|
||
# Nupkg artifacts | ||
*.nupkg | ||
*.snupkg | ||
|
||
# NCrunch artifacts | ||
*.ncrunch* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
DOTNET_SDK_PATH=./.dotnet | ||
mkdir -p "$DOTNET_SDK_PATH" | ||
|
||
if [[ $OS =~ [Ww]indows.* ]]; then | ||
echo "Downloading Windows .NET SDK installer into $DOTNET_SDK_PATH folder..." | ||
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.ps1 https://dot.net/v1/dotnet-install.ps1 | ||
echo "Installing .NET LTS SDK..." | ||
powershell.exe "$DOTNET_SDK_PATH"/dotnet-install.ps1 -Channel 6.0 -InstallDir "$DOTNET_SDK_PATH" -NoPath | ||
else | ||
echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..." | ||
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh | ||
echo "Installing .NET LTS SDK..." | ||
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 6.0 --install-dir "$DOTNET_SDK_PATH" --no-path | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
if [ -z "$PACKAGE_VERSION" ]; then | ||
PACKAGE_VERSION=$(sh ./evergreen/packages-version.sh) | ||
echo Calculated PACKAGE_VERSION value: "$PACKAGE_VERSION" | ||
fi | ||
|
||
echo Creating nuget package... | ||
|
||
dotnet clean ./CSharpDriver.sln | ||
dotnet pack ./CSharpDriver.sln -o ./build/nuget -c Release -p:Version="$PACKAGE_VERSION" --include-symbols -p:SymbolPackageFormat=snupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
set +o xtrace # Disable tracing. | ||
|
||
if [ -z "$PACKAGES_SOURCE" ]; then | ||
echo "PACKAGES_SOURCE variable should be set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$PACKAGES_SOURCE_KEY" ]; then | ||
echo "PACKAGES_SOURCE_KEY variable should be set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$PACKAGE_VERSION" ]; then | ||
echo "PACKAGE_VERSION variable should be set" | ||
exit 1 | ||
fi | ||
|
||
dotnet nuget push --source "$PACKAGES_SOURCE" --api-key "$PACKAGES_SOURCE_KEY" ./build/nuget/MongoDB.Bson."$PACKAGE_VERSION".nupkg | ||
dotnet nuget push --source "$PACKAGES_SOURCE" --api-key "$PACKAGES_SOURCE_KEY" ./build/nuget/MongoDB.Driver.Core."$PACKAGE_VERSION".nupkg | ||
dotnet nuget push --source "$PACKAGES_SOURCE" --api-key "$PACKAGES_SOURCE_KEY" ./build/nuget/MongoDB.Driver."$PACKAGE_VERSION".nupkg | ||
dotnet nuget push --source "$PACKAGES_SOURCE" --api-key "$PACKAGES_SOURCE_KEY" ./build/nuget/MongoDB.Driver.GridFS."$PACKAGE_VERSION".nupkg | ||
dotnet nuget push --source "$PACKAGES_SOURCE" --api-key "$PACKAGES_SOURCE_KEY" ./build/nuget/mongocsharpdriver."$PACKAGE_VERSION".nupkg | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
if [ -z "$PACKAGE_TARGET" ]; then | ||
# Use production release tag if nothing was passed | ||
PACKAGE_TARGET="release" | ||
fi | ||
|
||
if [ "${PACKAGE_TARGET}" = "dev" ]; then | ||
PACKAGE_VERSION_MATCH="v[0-9]*.[0-9]*.[0-9]*-dev[0-9]*" | ||
PACKAGE_VERSION_EXCLUDE="" | ||
elif [ "${PACKAGE_TARGET}" = "release" ]; then | ||
PACKAGE_VERSION_MATCH="v[0-9]*.[0-9]*.[0-9]*" | ||
PACKAGE_VERSION_EXCLUDE="*-dev[0-9]*" | ||
else | ||
echo "Unexpected value of PACKAGE_TARGET: ${PACKAGE_TARGET}" | ||
fi | ||
|
||
PACKAGE_VERSION=$(git describe --tags --abbrev=0 --match="${PACKAGE_VERSION_MATCH}" --exclude="${PACKAGE_VERSION_EXCLUDE}") | ||
PACKAGE_VERSION=$(echo $PACKAGE_VERSION | cut -c 2-) | ||
echo "$PACKAGE_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters