Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish CI pipeline #15

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish to PyPi
on:
push:
tags:
- "v*.*.*"

jobs:
build-distribution:
name: "Build distribution"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout tag/branch"
uses: "actions/checkout@v3"
- name: "Setup Python"
uses: "actions/setup-python@v3"
with:
python-version: "3.9"

- name: "Install build dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt

- name: "Build wheels & source dist"
run: |
hatch build dist

- name: Store artifacts
uses: actions/upload-artifact@v2
with:
name: source-dist
path: dist

PyPi:
needs: ["build-distribution"]
name: "Publish to PyPi"
runs-on: "ubuntu-latest"
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: source-dist
path: dist

- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt
hatch publish dist -r main -u __token__ -a ${{ secrets.PYPI_API_TOKEN }}
Loading