|
| 1 | +name: Build and upload to PyPI (v6.1) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - 'projects/mpy-cross-v6.1/**' |
| 9 | + - .github/workflows/publish-v6.1.yml |
| 10 | + tags: |
| 11 | + - mpy-cross-v6.1/* |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + paths: |
| 16 | + - 'projects/mpy-cross-v6.1/**' |
| 17 | + - .github/workflows/publish-v6.1.yml |
| 18 | + |
| 19 | +jobs: |
| 20 | + build_wheels: |
| 21 | + name: Build wheels on ${{ matrix.os }} |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + os: [ubuntu-22.04, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest] |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v5 |
| 29 | + with: |
| 30 | + submodules: true |
| 31 | + |
| 32 | + - name: Build wheels |
| 33 | + |
| 34 | + env: |
| 35 | + CIBW_ARCHS_MACOS: x86_64 arm64 |
| 36 | + CIBW_ARCHS_LINUX: auto |
| 37 | + CIBW_ARCHS_WINDOWS: auto |
| 38 | + with: |
| 39 | + package-dir: ./projects/mpy-cross-v6.1 |
| 40 | + |
| 41 | + - uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: artifact-${{ matrix.os }} |
| 44 | + path: ./wheelhouse/*.whl |
| 45 | + |
| 46 | + build_sdist: |
| 47 | + name: Build source distribution |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v5 |
| 51 | + with: |
| 52 | + submodules: true |
| 53 | + |
| 54 | + - name: Build sdist |
| 55 | + run: pipx run build --sdist projects/mpy-cross-v6.1 |
| 56 | + |
| 57 | + - uses: actions/upload-artifact@v4 |
| 58 | + with: |
| 59 | + name: artifact-source |
| 60 | + path: projects/mpy-cross-v6.1/dist/*.tar.gz |
| 61 | + |
| 62 | + upload_pypi: |
| 63 | + needs: [build_wheels, build_sdist] |
| 64 | + runs-on: ubuntu-latest |
| 65 | + permissions: |
| 66 | + # IMPORTANT: this permission is mandatory for trusted publishing |
| 67 | + id-token: write |
| 68 | + # upload to PyPI on every tag |
| 69 | + if: github.event_name == 'push' && github.ref_type == 'tag' |
| 70 | + steps: |
| 71 | + - uses: actions/download-artifact@v5 |
| 72 | + with: |
| 73 | + pattern: artifact-* |
| 74 | + merge-multiple: true |
| 75 | + path: dist |
| 76 | + |
| 77 | + |
0 commit comments