
committed by
GitHub

No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 224 additions and 6 deletions
-
1.editorconfig
-
1.gitignore
-
143evergreen/evergreen.yml
-
17evergreen/install-dotnet.sh
-
12evergreen/packages-pack.sh
-
26evergreen/packages-push.sh
-
21evergreen/packages-version.sh
-
2src/MongoDB.Bson/MongoDB.Bson.csproj
-
2src/MongoDB.Driver.Core/MongoDB.Driver.Core.csproj
-
2src/MongoDB.Driver.GridFS/MongoDB.Driver.GridFS.csproj
-
1src/MongoDB.Driver.Legacy/MongoDB.Driver.Legacy.csproj
-
2src/MongoDB.Driver/MongoDB.Driver.csproj
@ -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 |
@ -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 |
@ -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 |
|||
|
|||
|
@ -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" |
Write
Preview
Loading…
Cancel
Save
Reference in new issue