Version 0.6.1 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml | |
name: Upload Python Package | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: read | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
pip install twine | |
pip install dunamai | |
- name: Show version based on git tag | |
run: dunamai from git --style semver | |
- name: Ensure that program and tag version match | |
run: | | |
PACKAGE_VERSION=$(python -c "from src.pg_lock_tracer import __version__; print(__version__)") | |
GIT_VERSION=$(dunamai from git --style semver) | |
if [[ "$PACKAGE_VERSION" != "$GIT_VERSION" ]]; then | |
echo "Version mismatch ${PACKAGE_VERSION} / ${GIT_VERSION}" | |
exit 1 | |
fi | |
- name: Build package | |
run: python -m build | |
- name: Upload to test.pypi | |
run: 'twine upload --non-interactive --repository testpypi dist/*' | |
env: | |
TWINE_USERNAME: '__token__' | |
TWINE_PASSWORD: '${{ secrets.TWINE_PASSWORD_TEST }}' | |
- name: Upload to pypi | |
run: 'twine upload --non-interactive dist/*' | |
env: | |
TWINE_USERNAME: '__token__' | |
TWINE_PASSWORD: '${{ secrets.TWINE_PASSWORD }}' |