Publish Packages #32
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 Packages | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
concurrency: | |
group: "publish" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build wheel | |
pip install -e '.[dev]' | |
- name: Build package | |
run: | | |
python -m build --wheel --sdist | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
- name: Move wheels to dist directory | |
run: | | |
mkdir -p final_dist | |
find dist -name "*.whl" -exec mv {} final_dist/ \; | |
find dist -name "*.tar.gz" -exec mv {} final_dist/ \; | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: final_dist/ |