Compare commits

..

2 Commits

Author SHA1 Message Date
5172bdabaf Merge pull request 'add version amtch check' (#2) from sidiesen/test into main
All checks were successful
CI / linter (ubuntu-latest, 3.9) (push) Successful in 34s
Rename the project from template / rename-project (push) Successful in 25s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m6s
CI / tests_linux (ubuntu-latest, 3.9) (push) Successful in 31s
Reviewed-on: #2
2024-11-13 07:58:12 -08:00
08860faa46 add version amtch check
Some checks failed
CI / linter (ubuntu-latest, 3.9) (pull_request) Successful in 42s
SonarQube Scan / SonarQube Trigger (pull_request) Successful in 58s
CI / tests_linux (ubuntu-latest, 3.9) (pull_request) Successful in 33s
Upload Python Package / Create Release (push) Successful in 29s
Rename the project from template / rename-project (push) Successful in 26s
Upload Python Package / deploy (push) Failing after 30s
2024-11-13 16:54:42 +01:00

View File

@ -6,7 +6,7 @@ on:
push: push:
# Sequence of patterns matched against refs/tags # Sequence of patterns matched against refs/tags
tags: tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10 - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:
@ -43,6 +43,17 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install setuptools wheel twine pip install setuptools wheel twine
- name: Check version match
run: |
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')
test "$(cat $REPOSITORY_NAME/VERSION)" = "${GITHUB_REF_NAME:1}"
SUCCESS=$?
if $SUCCESS; then
echo "Version matches successfully!"
else
echo "Version must match!"
return -1
fi
- name: Build and publish - name: Build and publish
env: env:
TWINE_USERNAME: __token__ TWINE_USERNAME: __token__
@ -50,6 +61,5 @@ jobs:
run: | run: |
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}') REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
echo "uploading to: https://git.disi.dev/api/packages/$REPOSITORY_OWNER/pypi"
twine upload --repository-url https://git.disi.dev/api/packages/$REPOSITORY_OWNER/pypi -u gitearobot -p ${{ secrets.PACKAGE_GITEA_PAT }} dist/* twine upload --repository-url https://git.disi.dev/api/packages/$REPOSITORY_OWNER/pypi -u gitearobot -p ${{ secrets.PACKAGE_GITEA_PAT }} dist/*