|
8 | 8 | test_package:
|
9 | 9 | uses: ./.github/workflows/test_package.yml
|
10 | 10 |
|
11 |
| - build: |
| 11 | + build_wheels: |
12 | 12 | needs: test_package
|
13 |
| - permissions: |
14 |
| - id-token: write |
15 |
| - contents: read |
16 |
| - runs-on: ubuntu-latest |
| 13 | + name: Build wheels on ${{ matrix.os }} |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + env: |
| 16 | + INSTALL_ENDF_PARSERPY_CPP: yes |
| 17 | + |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + os: [ubuntu-latest, windows-latest, macos-13, macos-14] |
| 21 | + |
17 | 22 | steps:
|
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - uses: actions/setup-python@v5 |
| 26 | + |
| 27 | + - name: Install cibuildwheel |
| 28 | + run: python -m pip install cibuildwheel==2.18.1 |
| 29 | + |
| 30 | + - name: Build wheels |
| 31 | + run: python -m cibuildwheel --output-dir wheelhouse |
| 32 | + |
| 33 | + - uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 36 | + path: ./wheelhouse/*.whl |
| 37 | + |
| 38 | + make_sdist: |
| 39 | + name: Make source distribution package |
| 40 | + needs: test_package |
| 41 | + runs-on: ubuntu-latest |
18 | 42 |
|
19 |
| - - uses: actions/checkout@v3 |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
20 | 45 |
|
21 |
| - - uses: actions/setup-python@v4 |
| 46 | + - uses: actions/setup-python@v5 |
22 | 47 | with:
|
23 |
| - python-version: 3.x |
| 48 | + python-version: "3.x" |
24 | 49 |
|
25 |
| - - name: Install dependencies |
26 |
| - run: | |
27 |
| - python -m pip install --upgrade pip |
28 |
| - pip install poetry |
| 50 | + - name: Install build |
| 51 | + run: python -m pip install build |
29 | 52 |
|
30 |
| - - name: Build the package |
31 |
| - run: | |
32 |
| - poetry version $(git describe --tags --abbrev=0) |
33 |
| - poetry build |
| 53 | + - name: Build SDist |
| 54 | + run: python -m build --sdist |
34 | 55 |
|
35 |
| - - name: Mint token |
36 |
| - id: mint-token |
37 |
| - |
| 56 | + - uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: cibw-sdist |
| 59 | + path: dist/*.tar.gz |
38 | 60 |
|
39 |
| - - name: Publish package |
40 |
| - run: | |
41 |
| - poetry publish -u __token__ -p '${{ steps.mint-token.outputs.api-token }}' |
| 61 | + upload_all: |
| 62 | + needs: [build_wheels, make_sdist] |
| 63 | + environment: pypi |
| 64 | + permissions: |
| 65 | + id-token: write |
| 66 | + runs-on: ubuntu-latest |
| 67 | + if: github.event_name == 'push' |
| 68 | + steps: |
| 69 | + - uses: actions/download-artifact@v4 |
| 70 | + with: |
| 71 | + pattern: cibw-* |
| 72 | + path: dist |
| 73 | + merge-multiple: true |
| 74 | + |
| 75 | + - uses: pypa/gh-action-pypi-publish@release/v1 |
| 76 | + with: |
| 77 | + user: __token__ |
| 78 | + password: ${{ secrets.PYPI_TOKEN }} |
0 commit comments