|
9 | 9 | - 'prerelease-v[0-9]+.[0-9]+.[0-9]+**' |
10 | 10 | jobs: |
11 | 11 | build_wheels: |
12 | | - name: Build universal wheel |
13 | | - runs-on: ubuntu-latest |
| 12 | + uses: explosion/gha-cibuildwheel/cibuildwheel.yml@main |
| 13 | + with: |
| 14 | + pure-python: true |
| 15 | + secrets: |
| 16 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
14 | 17 |
|
15 | | - steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - - name: Configure Python version |
18 | | - uses: actions/setup-python@v4 |
19 | | - with: |
20 | | - python-version: "3.11" |
21 | | - architecture: x64 |
22 | | - - name: Build wheels |
23 | | - run: | |
24 | | - python -m pip install wheel |
25 | | - python -m pip wheel . -w ./wheelhouse |
26 | | - - uses: actions/upload-artifact@v4 |
27 | | - with: |
28 | | - name: cibw-wheel-pure |
29 | | - path: wheelhouse/confection-*.whl |
30 | | - |
31 | | - build_sdist: |
32 | | - name: Build source distribution |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - uses: actions/checkout@v4 |
36 | | - |
37 | | - - name: Build sdist |
38 | | - run: pipx run build --sdist |
39 | | - - uses: actions/upload-artifact@v4 |
40 | | - with: |
41 | | - name: cibw-sdist |
42 | | - path: dist/*.tar.gz |
43 | | - create_release: |
44 | | - needs: [build_wheels, build_sdist] |
45 | | - runs-on: ubuntu-latest |
46 | | - permissions: |
47 | | - contents: write |
48 | | - checks: write |
49 | | - actions: read |
50 | | - issues: read |
51 | | - packages: write |
52 | | - pull-requests: read |
53 | | - repository-projects: read |
54 | | - statuses: read |
55 | | - steps: |
56 | | - - name: Get the tag name and determine if it's a prerelease |
57 | | - id: get_tag_info |
58 | | - run: | |
59 | | - FULL_TAG=${GITHUB_REF#refs/tags/} |
60 | | - if [[ $FULL_TAG == release-* ]]; then |
61 | | - TAG_NAME=${FULL_TAG#release-} |
62 | | - IS_PRERELEASE=false |
63 | | - elif [[ $FULL_TAG == prerelease-* ]]; then |
64 | | - TAG_NAME=${FULL_TAG#prerelease-} |
65 | | - IS_PRERELEASE=true |
66 | | - else |
67 | | - echo "Tag does not match expected patterns" >&2 |
68 | | - exit 1 |
69 | | - fi |
70 | | - echo "FULL_TAG=$TAG_NAME" >> $GITHUB_ENV |
71 | | - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV |
72 | | - echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV |
73 | | - - uses: actions/download-artifact@v4 |
74 | | - with: |
75 | | - # unpacks all CIBW artifacts into dist/ |
76 | | - pattern: cibw-* |
77 | | - path: dist |
78 | | - merge-multiple: true |
79 | | - - name: Create Draft Release |
80 | | - id: create_release |
81 | | - uses: softprops/action-gh-release@v2 |
82 | | - if: startsWith(github.ref, 'refs/tags/') |
83 | | - env: |
84 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
85 | | - with: |
86 | | - name: ${{ env.TAG_NAME }} |
87 | | - draft: true |
88 | | - prerelease: ${{ env.IS_PRERELEASE }} |
89 | | - files: "./dist/*" |
0 commit comments