mfgames-cil/Justfile

77 lines
2.2 KiB
Makefile
Raw Normal View History

2023-07-10 04:11:38 +00:00
set dotenv-load := true
@_default:
just --choose
2023-07-10 04:27:05 +00:00
# Cleans out the packages.
clean:
dotnet clean
# Builds all of the components of this repository.
build:
dotnet build
# Runs all the known tests in the repository.
test: restore-tools
dotnet test \
--test-adapter-path:. \
--logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" \
2023-07-11 13:03:46 +00:00
--collect:"XPlat Code Coverage" \
-v:q --nologo
dotnet tool run reportgenerator \
-reports:tests/*/TestResults/*/coverage.cobertura.xml \
-targetdir:./coverage \
"-reporttypes:Cobertura;TextSummary"
grep "Line coverage" coverage/Summary.txt
# Restores all the tools and NuGet packages.
restore: restore-tools restore-packages
# Restores all the dotnet tools used.
restore-tools:
dotnet tool restore
# Restores all the NuGet packages.
restore-packages:
dotnet restore
2023-07-10 04:27:05 +00:00
# Performs a release on all the packages.
release: clean build
#!/usr/bin/env bash
# Verify that all the variables are set.
if [ "x$GITEA_TOKEN" = "x" ]; then
echo "the environment variable GITEA_TOKEN is not defined"
exit 1
fi
# Publish the packages.
dotnet pack -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg || exit 1
dotnet nuget remove source publish >&/dev/null
#dotnet nuget add source --name publish --username dmoonfire --password $GITEA_TOKEN https://src.mfgames.com/api/packages/mfgames-cil/nuget/index.json --store-password-in-clear-text || exit 1
#dotnet nuget push --skip-duplicate --source publish src/*/bin/Debug/*.nupkg || exit 1
dotnet nuget remove source publish >&/dev/null
# Go through and tag everything.
git remote add publish https://dmoonfire:$GITEA_TOKEN@src.mfgames.com/mfgames-cil/$(basename $(git config --get remote.origin.url))
for i in src/*/GitVersion.yml
do
# Move into the proper directory.
dir=$(dirname $i)
pkg=$(basename $dir)
pushd $dir
# Check the version and see if we've tagged it already.
tag="$pkg-$(dotnet gitversion /output json | jq -r .SemVer)"
echo "tagging $pkg with $tag"
#git tag $tag
#git push publish $tag
# Move back so we can finish.
popd
done
git remote remove publish