Publish Pypi #34
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: Publish Pypi | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
pytest: | |
name: Publish to PyPi | |
runs-on: ubuntu-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- uses: actions/checkout@master | |
- name: get version from tag | |
id: get_version | |
env: | |
TAG: ${{ github.event.release.tag_name }} | |
run: echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: ~/.virtualenvs | |
key: poetry-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ hashFiles('**/poetry.lock') }} | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.2.2 | |
virtualenvs-create: false | |
virtualenvs-in-project: false | |
installer-parallel: true | |
- name: Install Python dependencies | |
run: | | |
sudo apt-get install -y python-setuptools python3-setuptools | |
pip install poetry | |
poetry config virtualenvs.create false | |
poetry export --dev --without-hashes -o requirements.txt | |
pip install -r requirements.txt | |
poetry version ${{ steps.get_version.outputs.VERSION }} | |
poetry install | |
- name: Publish to PyPI | |
run: | | |
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }} --build |