release bugfix
Some checks failed
Rename the project from template / rename-project (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Has been skipped
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 11m37s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Simon Diesenreiter 2024-11-28 01:45:45 -08:00
parent 1a60804c28
commit 9183a5bd58

View File

@ -50,12 +50,16 @@ jobs:
fi
- name: Build and publish
env:
GITEA_USERNAME: gitearobot
GITEA_PASSWORD: ${{ secrets.PACKAGE_GITEA_PAT }}
GITEA_PAT: ${{ secrets.PACKAGE_GITEA_PAT }}
run: |
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
dotnet nuget add source --name gitea --username $GITEA_USERNAME --password $GITEA_PASSWORD https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json
dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) project_name.sln
dotnet nuget push --source gitea $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
REPOSITORY_SOURCE_NAME=gitea-repo
if [ -z "$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json")" ]; then
dotnet nuget add source --name $REPOSITORY_SOURCE_NAME 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
dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) DotnetTestLib.sln
dotnet nuget push -k $GITEA_PAT --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg