another fix 3.0
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 1s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Simon Diesenreiter 2024-11-28 00:52:31 -08:00
parent a15f0657a4
commit 858bd4a041

View File

@ -55,9 +55,13 @@ jobs:
run: | run: |
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}') REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_') REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
REPOSITORY_SOURCE_NAME=gitea-repo
if [ -z "$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json")" ]; then if [ -z "$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json")" ]; then
dotnet nuget add source --name gitea --username $GITEA_USERNAME --password $GITEA_PASSWORD https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json dotnet nuget add source --name $REPOSITORY_SOURCE_NAME --username $GITEA_USERNAME --password $GITEA_PASSWORD https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json
else
QUOTED_REPOSITORY_SOURCE_NAME=$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json" | awk '{print $2}' | awk -F= '{print $2}')
REPOSITORY_SOURCE_NAME=${QUOTED_REPOSITORY_SOURCE_NAME:1:-1}
fi fi
dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) DotnetTestLib.sln dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) DotnetTestLib.sln
dotnet nuget push --source gitea $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).nupkg dotnet nuget push --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).nupkg
dotnet nuget push --source gitea $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg dotnet nuget push --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg