build: set the version on release
Some checks failed
deploy / deploy (push) Failing after 31m7s

This commit is contained in:
D. Moonfire 2024-03-10 00:00:36 -06:00
parent 9dfa41bec2
commit ff974cb9bc

View file

@ -77,8 +77,22 @@ release-setup: restore-tools restore-packages
exit 1
fi
# Sets the version for all the packages based on conventional commits
# and semantic releases.
release-version:
#!/usr/bin/env bash
set -euo pipefail
cd src
for pkg in MfGames*
do
ver=$(mfgames-conventional-commit version --package $pkg)
dotnet setversion $ver $pkg/$pkg.csproj
done
# Creates and pushes the NuGet packages.
release-pack: release-setup
release-pack: release-setup release-version
# Rebuild the package in release mode.
dotnet clean --configuration Release
dotnet build --configuration Release
@ -105,20 +119,22 @@ release-nuget: release-pack
# Tags all the libraries for the release.
release-tag: release-setup
#!/usr/bin/env bash
set -euxo pipefail
set -euo pipefail
git remote remove publish || true
git remote add publish https://dmoonfire:$MFGAMES_GITEA_TOKEN@src.mfgames.com/mfgames-cil/$(basename $(git config --get remote.origin.url))
for i in src/*/version.json
cd src
for pkg in MfGames*
do
# Move into the proper directory.
dir=$(dirname $i)
pkg=$(basename $dir)
dir=$pkg
pushd $dir
# Check the version and see if we have tagged it already.
tag="$pkg-$(dotnet nbgv get-version --variable Version | cut -f 1-3 -d .)"
ver=$(mfgames-conventional-commit version --package $pkg)
tag="$pkg-$ver"
if git tag | grep $tag > /dev/null
then