Merge pull request #22 from marcom4rtinez/stable #4
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 nornir_infrahub to PyPI | |
on: # yamllint disable rule:truthy | |
push: | |
tags: | |
- "v*" | |
jobs: | |
publish_to_pypi: | |
name: "Publish nornir_infrahub to PyPI" | |
runs-on: "ubuntu-22.04" | |
steps: | |
- name: "Set up Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.11" | |
- name: "Install Poetry" | |
uses: "snok/install-poetry@v1" | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: "Check out repository code" | |
uses: "actions/checkout@v4" | |
- name: "Cache poetry venv" | |
uses: "actions/cache@v3" | |
id: "cached-poetry-dependencies" | |
with: | |
path: ".venv" | |
key: "venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}" | |
- name: "Install Dependencies" | |
run: "poetry install" | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
- name: "Add PyPI secret" | |
run: "poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}" | |
- name: "Poetry build" | |
run: "poetry build" | |
- name: "Poetry push PyPI" | |
run: "poetry publish" |