Skip to content

Workflow file for this run

name: Release Package to PyPI
on:
release:
types: [published]
env:
PACKAGE_DIR: equinix_metal
DIST_DIR: equinix_metal/dist
PYTHON_VERSION: 3.8
jobs:
build:
name: Build and publish package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
working-directory: ${{ env.PACKAGE_DIR }}
run: |
python -m pip install --upgrade build
- name: Build package
working-directory: ${{ env.PACKAGE_DIR }}
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Upload to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ${{ env.DIST_DIR }}