Skip to content

Commit

Permalink
Update GitHub workflows (#80)
Browse files Browse the repository at this point in the history
* Use unique cache key per job

* Upgrade actions and migrate to trusted publishers for PyPI

* Correct pre-commit version
  • Loading branch information
NoraLoose authored Aug 20, 2024
1 parent 6e5dc5b commit c162c39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
13 changes: 7 additions & 6 deletions .github/workflows/pypipublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
git restore -SW .
python -m build --sdist --wheel .
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: releases
path: dist
Expand All @@ -51,7 +51,7 @@ jobs:
name: Install Python
with:
python-version: '3.10'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: releases
path: dist
Expand All @@ -70,14 +70,15 @@ jobs:
needs: test-built-dist
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: releases
path: dist
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
username: "__token__"
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
repository-url: https://upload.pypi.org/legacy/
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
environment-file: ci/environment.yml
create-args: |
python=${{ matrix.python-version }}
cache-key: micromamba-${{ matrix.python-version }}-${{ runner.os }} # Add a unique cache key

- name: Conda info
run: conda info
Expand Down

0 comments on commit c162c39

Please sign in to comment.