|
13 | 13 |
|
14 | 14 | jobs: |
15 | 15 | pypi: |
16 | | - name: build and deploy to PyPI |
| 16 | + name: Build and Deploy to PyPI |
17 | 17 | runs-on: ubuntu-latest |
18 | 18 | permissions: |
19 | 19 | id-token: write |
| 20 | + |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + python-version: ["3.11", "3.12", "3.13"] |
| 24 | + |
20 | 25 | steps: |
21 | 26 | - name: Checkout source |
22 | | - uses: actions/checkout@v5.0.0 |
23 | | - - name: Set up Python 3.11 |
| 27 | + uses: actions/checkout@v5 |
| 28 | + |
| 29 | + - name: Set up Python ${{ matrix.python-version }} |
24 | 30 | uses: actions/setup-python@v6 |
25 | 31 | with: |
26 | | - python-version: 3.11 |
| 32 | + python-version: ${{ matrix.python-version }} |
| 33 | + |
27 | 34 | - name: Install build dependencies |
28 | 35 | run: python -m pip install build twine |
| 36 | + |
29 | 37 | - name: Build distributions |
30 | | - shell: bash -l {0} |
31 | 38 | run: | |
32 | 39 | git clean -xdf |
33 | | - pyproject-build |
34 | | - - name: Publish package to PyPI |
35 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
| 40 | + python -m build --wheel --sdist |
| 41 | +
|
| 42 | + - name: Upload artifacts |
| 43 | + uses: actions/upload-artifact@v4 |
| 44 | + with: |
| 45 | + name: dist-${{ matrix.python-version }} |
| 46 | + path: dist/ |
| 47 | + |
| 48 | + publish: |
| 49 | + # publish only once (not in matrix) |
| 50 | + name: Publish package to PyPI |
| 51 | + needs: pypi |
| 52 | + runs-on: ubuntu-latest |
| 53 | + permissions: |
| 54 | + id-token: write |
| 55 | + steps: |
| 56 | + - uses: actions/download-artifact@v4 |
| 57 | + with: |
| 58 | + path: dist/ |
| 59 | + - uses: pypa/gh-action-pypi-publish@release/v1 |
36 | 60 | with: |
37 | 61 | skip-existing: true |
38 | 62 |
|
39 | 63 | conda: |
40 | | - name: build and deploy to conda |
41 | | - needs: pypi |
| 64 | + name: Build and Deploy to Conda |
| 65 | + needs: publish |
42 | 66 | runs-on: ubuntu-latest |
| 67 | + |
| 68 | + strategy: |
| 69 | + matrix: |
| 70 | + python-version: ["3.11", "3.12", "3.13"] |
| 71 | + |
43 | 72 | steps: |
44 | 73 | - name: Checkout source |
45 | | - uses: actions/checkout@v5.0.0 |
| 74 | + uses: actions/checkout@v5 |
| 75 | + |
46 | 76 | - name: Wait for PyPI propagation |
47 | 77 | run: | |
48 | 78 | echo "Waiting for PyPI package to be downloadable..." |
@@ -74,11 +104,11 @@ jobs: |
74 | 104 | uses: conda-incubator/setup-miniconda@v3 |
75 | 105 | with: |
76 | 106 | miniconda-version: "latest" |
77 | | - python-version: 3.11 |
| 107 | + python-version: ${{ matrix.python-version }} |
78 | 108 | environment-file: .conda/environment.yml |
79 | 109 | auto-update-conda: false |
80 | 110 | auto-activate-base: false |
81 | | - show-channel-urls: true |
| 111 | + |
82 | 112 | - name: Build and upload the conda package |
83 | 113 | uses: ACCESS-NRI/action-build-and-upload-conda-packages@d97711bc4445ba5c4de55f5a1bccbd4815286289 |
84 | 114 | with: |
|
0 commit comments