Repository navigation
97 lines (84 loc) · 3.05 KB
/
Copy pathbuildAndUploadPyPi.yml
File metadata and controls
97 lines (84 loc) · 3.05 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Deploy to pypi for all plattforms
name: Build and upload to PyPI
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
# os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-14]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# - name: Install uv
# uses: astral-sh/setup-uv@v7
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.0
env:
CIBW_PLATFORM: ${{ matrix.platform || 'auto' }}
# CIBW_BUILD_FRONTEND: "build[uv]"
CIBW_BEFORE_BUILD_LINUX: >
python {package}/avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
CIBW_BEFORE_BUILD_WINDOWS: >
choco install mingw -y &&
python {package}/avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
CIBW_BEFORE_BUILD_MACOS: >
python {package}/avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
CIBW_ENVIRONMENT: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy cython build
- name: Compile MoT-Voellmy binaries
run: |
python avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
sudo apt-get install -y gcc-mingw-w64-x86-64
C_FILE=$(ls avaframe/com9MoTVoellmy/MoT-Voellmy.*.c 2>/dev/null | head -1)
if [ -n "$C_FILE" ]; then
x86_64-w64-mingw32-gcc -Wall -pedantic -o avaframe/com9MoTVoellmy/MoT-Voellmy_win.exe "$C_FILE" -lm
fi
- name: create source distribution
run: python -m build
# - name: Build sdist
# run: pipx run build --sdist
- uses: actions/upload-artifact@v7
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v8
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1