From 3c93561fad8ad2112f7a76ac8e8d6f8fa1f5873c Mon Sep 17 00:00:00 2001 From: Emmie Le Roy <47359313+emmleroy@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:16:28 -0400 Subject: [PATCH 1/2] Update gh-actions with PyPA's pypi-publish action and bump versions --- .github/workflows/build-and-deploy-docs.yml | 10 +++++++--- .github/workflows/docs-preview.yml | 2 +- .github/workflows/release.yml | 11 +++++++---- .github/workflows/test-and-verify.yml | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-deploy-docs.yml b/.github/workflows/build-and-deploy-docs.yml index 34be69f..4bc7d09 100644 --- a/.github/workflows/build-and-deploy-docs.yml +++ b/.github/workflows/build-and-deploy-docs.yml @@ -1,7 +1,11 @@ name: docs/gh-pages on: release: - types: [workflow_dispatch, released] + types: [released] + workflow_dispatch: + +permissions: + contents: write jobs: build-docs: @@ -12,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Setup python - uses: actions/setup-python@master + uses: actions/setup-python@v4 with: python-version: 3.10.5 @@ -26,7 +30,7 @@ jobs: - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 43e3cc0..14c6171 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -14,7 +14,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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bb1c19..905b074 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,8 @@ jobs: 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 @@ -27,7 +29,8 @@ jobs: - 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 }} \ No newline at end of file + - name: Build package + run: poetry build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publisher@release/v1 \ No newline at end of file diff --git a/.github/workflows/test-and-verify.yml b/.github/workflows/test-and-verify.yml index 06cacb6..be2e729 100644 --- a/.github/workflows/test-and-verify.yml +++ b/.github/workflows/test-and-verify.yml @@ -17,7 +17,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 From c692982e2220c73bbfa0485d902feb9b1e024071 Mon Sep 17 00:00:00 2001 From: Emmie Le Roy <47359313+emmleroy@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:50:00 -0400 Subject: [PATCH 2/2] Fix indentations in gh-actions --- .github/workflows/build-and-deploy-docs.yml | 81 +++++++++++---------- .github/workflows/docs-preview.yml | 1 + .github/workflows/release.yml | 51 ++++++------- .github/workflows/test-and-verify.yml | 2 + 4 files changed, 70 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-and-deploy-docs.yml b/.github/workflows/build-and-deploy-docs.yml index 4bc7d09..205618d 100644 --- a/.github/workflows/build-and-deploy-docs.yml +++ b/.github/workflows/build-and-deploy-docs.yml @@ -1,4 +1,5 @@ name: docs/gh-pages + on: release: types: [released] @@ -6,51 +7,51 @@ on: 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@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: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - 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 \ No newline at end of file + - 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 \ No newline at end of file diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 14c6171..6f0d862 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -1,4 +1,5 @@ name: docs/preview + on: pull_request: paths: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 905b074..6cd55db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,36 +1,37 @@ name: build & release + on: release: types: [published] jobs: - 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 + 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 package - run: poetry build + - name: Build package + run: poetry build - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publisher@release/v1 \ No newline at end of file + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publisher@release/v1 \ No newline at end of file diff --git a/.github/workflows/test-and-verify.yml b/.github/workflows/test-and-verify.yml index be2e729..19c86e1 100644 --- a/.github/workflows/test-and-verify.yml +++ b/.github/workflows/test-and-verify.yml @@ -1,5 +1,7 @@ name: run and build + on: [pull_request] + jobs: tests: runs-on: ubuntu-latest