Merge pull request #59 from opsmill/develop #2
Workflow file for this run
This file contains hidden or 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 Infrahub Python SDK | |
on: # yamllint disable rule:truthy | |
push: | |
tags: | |
- "v*" | |
jobs: | |
publish_to_pypi: | |
name: "Publish Infrahub SDK to PyPI" | |
runs-on: "ubuntu-22.04" | |
steps: | |
- name: "Set up Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.12" | |
- 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@v4" | |
id: "cached-poetry-dependencies" | |
with: | |
path: "./python_sdk/.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: "show output" | |
run: "ls -la dist/" | |
- name: "Poetry push PyPI" | |
run: "poetry publish" |