|
1 |
| -name: Python Package using Conda |
| 1 | +name: Gen sdist and upload to PyPI |
2 | 2 |
|
3 | 3 | env:
|
4 | 4 | CIBW_TEST_REQUIRES: pytest
|
5 | 5 | CIBW_TEST_COMMAND: "pytest tests"
|
6 | 6 |
|
7 |
| -on: [push] |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + pull_request: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + release: |
| 14 | + types: |
| 15 | + - published |
8 | 16 |
|
9 | 17 | jobs:
|
10 |
| - make_sdist: |
11 |
| - name: Make SDist |
| 18 | + # build_wheels: |
| 19 | + # name: Build wheels on ${{ matrix.os }} |
| 20 | + # runs-on: ${{ matrix.os }} |
| 21 | + # strategy: |
| 22 | + # matrix: |
| 23 | + # # macos-13 is an intel runner, macos-14 is apple silicon |
| 24 | + # os: [ubuntu-22.04, windows-2022, macos-13, macos-14] |
| 25 | + |
| 26 | + # steps: |
| 27 | + # - uses: actions/checkout@v4 |
| 28 | + |
| 29 | + # - name: Build wheels |
| 30 | + |
| 31 | + |
| 32 | + # - uses: actions/upload-artifact@v4 |
| 33 | + # with: |
| 34 | + # name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 35 | + # path: ./wheelhouse/*.whl |
| 36 | + build_sdist: |
| 37 | + name: Build source distribution |
12 | 38 | runs-on: ubuntu-latest
|
13 | 39 | steps:
|
14 |
| - - uses: actions/checkout@v4 |
15 |
| - with: |
16 |
| - fetch-depth: 0 # Optional, use if you use setuptools_scm |
17 |
| - submodules: true # Optional, use if you have submodules |
18 |
| - |
19 |
| - - name: Build SDist |
20 |
| - run: pipx run build --sdist |
21 |
| - |
22 |
| - - uses: actions/upload-artifact@v4 |
23 |
| - with: |
24 |
| - name: cibw-sdist |
25 |
| - path: dist/*.tar.gz |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Build sdist |
| 43 | + run: pipx run build --sdist |
| 44 | + |
| 45 | + - uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: cibw-sdist |
| 48 | + path: dist/*.tar.gz |
| 49 | + |
| 50 | + upload_pypi: |
| 51 | + needs: [build_sdist] |
| 52 | + runs-on: ubuntu-latest |
| 53 | + environment: pypi |
| 54 | + permissions: |
| 55 | + id-token: write |
| 56 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 57 | + steps: |
| 58 | + - uses: actions/download-artifact@v4 |
| 59 | + with: |
| 60 | + # unpacks all CIBW artifacts into dist/ |
| 61 | + pattern: cibw-* |
| 62 | + path: dist |
| 63 | + merge-multiple: true |
| 64 | + |
| 65 | + - uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments