Skip to content

v0.0.1

v0.0.1 #1

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
env:
PYTHON_VERSION: "3.12"
POETRY_VERSION: "1.8.3"
POETRY_URL: https://install.python-poetry.org
jobs:
build:
name: 📦 Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
id: setup_python
- name: Cache Poetry cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Cache Packages
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Install Poetry
run: |
curl -sSL ${{ env.POETRY_URL }} | python3 - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --only main
- name: Build dist
run: poetry build
- name: Verify wheel installation
run: |
mkdir -p verify
cd verify
python3 -m venv venv
venv/bin/pip install ../dist/*.whl
venv/bin/python -c "import ftl_extract; print(ftl_extract.__version__)"
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish:
name: 🐍 Publish
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ftl-extract
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1