From ff7093f890ea27a25a486c6b901c8140d797532c Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Wed, 13 Nov 2024 18:11:55 +0100 Subject: [PATCH] more bugfixes --- .gitea/workflows/release.yml | 50 +++++++++++++++++------------ .gitea/workflows/rename_project.yml | 2 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 380dd92..92528eb 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -30,23 +30,33 @@ jobs: with: body_path: release_message.md - # deploy: - # needs: release - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: '3.x' - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install setuptools wheel twine - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - # run: | - # python setup.py sdist bdist_wheel - # twine upload dist/* + deploy: + needs: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Check version match + run: | + REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]') + 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/* diff --git a/.gitea/workflows/rename_project.yml b/.gitea/workflows/rename_project.yml index a5d676a..ad97c94 100644 --- a/.gitea/workflows/rename_project.yml +++ b/.gitea/workflows/rename_project.yml @@ -6,7 +6,7 @@ permissions: write-all jobs: rename-project: - if: ${{ !endsWith (github.repository, 'Templates/Python') }} + if: ${{ !endsWith (gitea.repository, 'Templates/Python') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 -- 2.45.2