diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 380dd92..f3bda9b 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -30,23 +30,25 @@ 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: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}') + python setup.py sdist bdist_wheel + twine upload --repository-url -u gitearobot -p ${{ secrets.PACKAGE_GITEA_PAT }} https://git.disi.dev/api/packages/$REPOSITORY_OWNER/pypi dist/* +