-
-
Notifications
You must be signed in to change notification settings - Fork 10
107 lines (86 loc) · 2.47 KB
/
pypi-publish.yml
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
98
99
100
101
102
103
104
105
106
107
name: Upload Python Package to PyPI
on:
release:
types: [ published, edited ]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Validate exts version matching
run: |
python -m pip install tomli
python hooks/version_check.py
- name: Install dependencies
run: |
python -m pip install build cibuildwheel twine
- name: Build pure python package
run: python -m build
- name: Build binary python package
run: |
cd ./py_ballisticcalc.exts
python -m build --sdist --outdir ../dist
cibuildwheel --output-dir ../dist
cd ..
- name: List ./dist
run: ls ./dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: ./dist
publish:
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Download artifacts (Ubuntu)
uses: actions/download-artifact@v4
with:
name: dist-ubuntu-latest
path: ./dist-ubuntu
- name: Download artifacts (Windows)
uses: actions/download-artifact@v4
with:
name: dist-windows-latest
path: ./dist-windows
- name: Download artifacts (macOS 13)
uses: actions/download-artifact@v4
with:
name: dist-macos-13
path: ./dist-macos-13
- name: Download artifacts (macOS 14)
uses: actions/download-artifact@v4
with:
name: dist-macos-14
path: ./dist-macos-14
- name: Combine artifacts
run: |
mkdir -p dist
cp ./dist-ubuntu/* dist/ || true
cp ./dist-windows/* dist/ || true
cp ./dist-macos-13/* dist/ || true
cp ./dist-macos-14/* dist/ || true
- name: List ./dist
run: ls ./dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true