Skip to content

Commit

Permalink
Split package and docs build and fix dependency install
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarro committed Apr 15, 2024
1 parent 1ebce4e commit 4c762d2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build & Publish Package

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-and-publish-docs:
name: Build and publish docs
runs-on: ubuntu-latest
if: ${{ github.event.inputs.docs == 'true' }}

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements*.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Build docs
run: mkdocs build

- name: Publish docs
uses: JamesIves/[email protected]
with:
branch: docs
folder: site
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ name: Build & Publish Package
on:
release:
types: [published]
workflow_dispatch:
inputs:
docs:
description: 'Builds and publishes docs after building and publishing the package. Default is true.'
required: false
default: 'true'

jobs:
build-release:
Expand All @@ -21,11 +15,14 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements*.txt

- name: Install packages
run: |
python -m pip install --upgrade pip build
python -m pip install --upgrade --upgrade-strategy eager -e ".[dev]"
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Build a binary wheel and a source tarball
run: |
Expand Down Expand Up @@ -55,29 +52,3 @@ jobs:
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true

build-and-publish-docs:
name: Build and publish docs
runs-on: ubuntu-latest
if: ${{ github.event.inputs.docs == 'true' }}

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: Pipfile

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade --upgrade-strategy eager -e ".[dev]"
mkdocs build
- name: Publish docs
uses: JamesIves/[email protected]
with:
branch: docs
folder: site

0 comments on commit 4c762d2

Please sign in to comment.