-
Notifications
You must be signed in to change notification settings - Fork 10
66 lines (52 loc) · 1.53 KB
/
publish-pypi.yaml
File metadata and controls
66 lines (52 loc) · 1.53 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
62
63
64
65
66
name: Publish to PyPi
permissions:
actions: write
on:
push:
tags:
- '*'
jobs:
pypi-release:
name: PyPi Release
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: Compile
run: |
uv --directory tooling run wrap build python
- name: Build Python packages
run: |
# First, see what packages we have
echo "Available packages in dist/niwrap-python/:"
ls -la dist/niwrap-python/
# Create a directory for the built packages
mkdir -p dist/built_packages
# Build each package using uv
for pkg_dir in dist/niwrap-python/*/; do
# Skip symbolmaps directory
if [[ "$pkg_dir" == *"/symbolmaps/" ]]; then
echo "Skipping $pkg_dir"
continue
fi
echo "Building package in $pkg_dir"
cd "$pkg_dir"
# Build source distribution and wheel using uv
uv build --sdist --wheel -o ../../built_packages
cd - # Return to original directory
done
# Verify built packages
echo "Built packages:"
ls -la dist/built_packages/
- name: Publish to PyPi
id: pypi_publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
packages-dir: dist/built_packages