-
Notifications
You must be signed in to change notification settings - Fork 105
72 lines (58 loc) · 1.55 KB
/
build.yml
File metadata and controls
72 lines (58 loc) · 1.55 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
67
68
69
70
71
72
name: Build
on:
push:
branches: [develop, main, master]
tags:
- "v*"
pull_request:
branches: [develop, main, master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper versioning
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.12
- name: Build package
run: uv build
- name: Check distribution
run: uvx twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
test-install:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.12
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Create venv and install wheel
shell: bash
run: |
uv venv
uv pip install dist/*.whl
- name: Test import
shell: bash
run: |
if [ -f ".venv/bin/python" ]; then
.venv/bin/python -c "import pyphi; print('PyPhi imported successfully')"
else
.venv/Scripts/python -c "import pyphi; print('PyPhi imported successfully')"
fi