-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (57 loc) · 1.8 KB
/
Copy pathpypi-release.yml
File metadata and controls
61 lines (57 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# abi3 wheels: one build per platform covers cp310+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13]
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v3.2.1
- name: Verify ast-grep symbol is exported
if: runner.os == 'macOS'
run: |
python3 - <<'EOF'
import glob, subprocess, sys, tempfile, zipfile, os
whl = glob.glob("wheelhouse/*.whl")[0]
d = tempfile.mkdtemp()
zipfile.ZipFile(whl).extractall(d)
so = glob.glob(os.path.join(d, "tree_sitter_nextflow", "_binding*"))[0]
out = subprocess.run(["dyld_info", "-exports", so], capture_output=True, text=True).stdout
assert "_tree_sitter_nextflow" in out, f"symbol missing from export trie:\n{out}"
print("ok: _tree_sitter_nextflow exported")
EOF
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
build-sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
publish:
name: Publish to PyPI
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1