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

CD cleanup #226

Merged
merged 17 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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
87 changes: 51 additions & 36 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,59 @@ on:

jobs:

build:
name: build distribution for Python
# build docs for develop and main branches
build-docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1
# setup
- name: checkout
uses: actions/checkout@main
- name: setup-python
uses: actions/setup-python@main
# update repo visualization for docs
- name: repo-visualizer
uses: githubocto/repo-visualizer@main
with:
output_file: docs/reference/apidoc/diagram.svg
excluded_paths: ".github"
commit_message: "update repo diagram [skip ci]"
# install project, which is required for autodoc of code
- name: install buildingmotif
run: pip install .
# install jupyter-book, which for some reason isn't available with poetry install
- name: install jupyter book
run: pip install jupyter-book
# build docs, which are deployed by repo settings
- name: build docs
run: |
jupyter-book config sphinx ./docs/
sphinx-build ./docs/ _build/html -b html

- name: build
run: poetry build

publish:
name: publish distribution
needs: build
# deploy distribution if a new release and tag are created
deploy-dist:
needs: build-docs
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: snok/install-poetry@v1

- name: build
run: poetry build

- name: publish distribution 📦 to Test PyPI
if: ${{ github.base_ref == 'main' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# setup
- name: checkout
uses: actions/checkout@main
- name: setup-python
uses: actions/setup-python@main
# install poetry and build dist
- name: install poetry
run: pip install poetry
- name: build dist
run: poetry build
- name: publish distribution to Test PyPI
id: test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: publish distribution to PyPI
if: steps.test-pypi.outcome == 'success'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
50 changes: 0 additions & 50 deletions .github/workflows/docs.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/repo-vis.yml

This file was deleted.