more fixes

This commit is contained in:
2024-11-27 20:16:33 +01:00
parent a6bae9dc80
commit b6edae42f6
3 changed files with 30 additions and 9 deletions

View File

@@ -45,18 +45,21 @@ jobs:
pip install setuptools wheel twine
- name: Check version match
run: |
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_'')
if [ "$(cat $REPOSITORY_NAME/VERSION)" = "${GITHUB_REF_NAME:1}" ] ; then
echo "Version matches successfully!"
else
echo "Version must match!"
exit -1
fi
- name: Build and publish
env:
TWINE_USERNAME: gitearobot
TWINE_PASSWORD: ${{ secrets.PACKAGE_GITEA_PAT }}
run: |
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
python setup.py sdist bdist_wheel
twine upload --repository-url https://git.disi.dev/api/packages/$REPOSITORY_OWNER/pypi dist/*
# - name: Build and publish
# env:
# GITEA_USERNAME: gitearobot
# GITEA_PASSWORD: ${{ 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