Skip to content

Commit

Permalink
Merge pull request #4 from rytheranderson/pypi-publish
Browse files Browse the repository at this point in the history
Add PyPI publish workflow
  • Loading branch information
rytheranderson authored Dec 2, 2023
2 parents 25590e4 + 3e51768 commit 03860fc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PyPI publish

on:
workflow_run:
workflows: ['Test on push']
types:
- completed

jobs:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyfracgen
permissions:
id-token: write
if: ${{ github.event.workflow_run.conclusion == 'success' }} # && startsWith(github.ref, "refs/tags/")
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Check pyproject.toml
run: poetry check --no-interaction
- name: Build
run: poetry build
# - name: Publish
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# skip-existing: true



16 changes: 12 additions & 4 deletions .github/workflows/test-on-push.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3
Expand All @@ -19,10 +19,18 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: true
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-deps
uses: actions/cache@v3
with:
path: |
.venv
.tox
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-deps.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
Expand Down

0 comments on commit 03860fc

Please sign in to comment.