Skip to content
Merged
Show file tree
Hide file tree
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
85 changes: 45 additions & 40 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,57 @@
name: docs/gh-pages

on:
release:
types: [workflow_dispatch, released]
types: [released]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to keep the workflow_dispatch that way you can rebuild without triggering a new release. Unless there's a reason not to...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I agree! workflow_dispatch is kept in the line below (above, types only accepts a release type so I moved it to its own top-level event type

workflow_dispatch:

permissions:
contents: write

jobs:
build-docs:
name: Build docs and push to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
name: Build docs and push to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@master
with:
python-version: 3.10.5
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.10.5

- name: Install poetry
uses: snok/install-poetry@v1.3.3
with:
version: 1.8.4
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install poetry
uses: snok/install-poetry@v1.3.3
with:
version: 1.8.4
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: build docs
run: |
source .venv/bin/activate
cd docs
make clean
make html
cd ..
- name: build docs
run: |
source .venv/bin/activate
cd docs
make clean
make html
cd ..

- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
email: dhagan@mit.edu
build_dir: docs/_build/html
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
email: dhagan@mit.edu
build_dir: docs/_build/html
3 changes: 2 additions & 1 deletion .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: docs/preview

on:
pull_request:
paths:
Expand All @@ -14,7 +15,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
uses: actions/setup-python@v4
with:
python-version: 3.10.5

Expand Down
50 changes: 27 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
name: build & release

on:
release:
types: [published]

jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.10.5
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.10.5

- name: Install poetry
uses: snok/install-poetry@v1.3.3
with:
version: 1.8.4
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install poetry
uses: snok/install-poetry@v1.3.3
with:
version: 1.8.4
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Build and publish to PyPI
run: |
poetry build
poetry publish -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}
- name: Build package
run: poetry build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publisher@release/v1
4 changes: 3 additions & 1 deletion .github/workflows/test-and-verify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: run and build

on: [pull_request]

jobs:
tests:
runs-on: ubuntu-latest
Expand All @@ -17,7 +19,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Install poetry
uses: snok/install-poetry@v1
uses: snok/install-poetry@v1.3.3
with:
version: 1.8.4
virtualenvs-create: true
Expand Down
Loading