v1.1.3 #6
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
name: Upload Python Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Autobump version | |
run: | | |
# from refs/tags/v1.2.3 get 1.2.3 | |
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##') | |
PLACEHOLDER='__version__ = "develop"' | |
VERSION_FILE='aqdefreader/__init__.py' | |
# ensure the placeholder is there. If grep doesn't find the placeholder | |
# it exits with exit code 1 and github actions aborts the build. | |
grep "$PLACEHOLDER" "$VERSION_FILE" | |
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE" | |
shell: bash | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
pip install -r requirements.txt | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* |