name: Publish on: push: tags: - 'v*' jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install tox wheel twine - name: Apply the tag version run: | version=${{ github.ref_name }} sed -i 's/__version__ = .*/__version__ = "'${version:1}'"/' src/keycloak/_version.py - name: Run build run: | tox -e build - name: Publish to PyPi env: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*