This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-toolbuilder-cil/scripts/release.sh

30 lines
712 B
Bash
Raw Normal View History

#!/usr/bin/env sh
2022-04-02 21:42:32 +00:00
cd $(dirname $0)/..
2022-04-02 21:42:32 +00:00
./scripts/setup.sh || exit 1
2022-04-02 21:42:32 +00:00
# Verify the input.
if [ "x$NUGET_TOKEN" = "x" ]
then
echo "The environment variable NUGET_TOKEN is not defined"
exit 1
fi
if [ "x$NUGET_PUSH_URL" = "x" ]
then
echo "The environment variable NUGET_PUSH_URL is not defined"
exit 1
fi
# Clean up everything from the previous runs.
dotnet clean
2022-04-02 21:42:32 +00:00
# Version the file based on the Git repository.
(cd src && dotnet dotnet-gitversion /updateprojectfiles)
# Build to pick up the new version.
dotnet build
2022-04-02 21:42:32 +00:00
# Create and publish the NuGet packages.
dotnet pack --include-symbols --include-source
dotnet nuget push src/*/bin/Debug/*.nupkg --api-key $NUGET_TOKEN --source $NUGET_PUSH_URL