-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (87 loc) · 2.78 KB
/
CD.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CD
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_package:
strategy:
fail-fast: false
matrix:
# Github Actions doesn't support pairing matrix values together, let's improvise
# Stolen from numpy deployment workflow
buildplat:
#- [ubuntu-22.04, manylinux_x86_64]
#- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
#- [windows-2019, win_amd64]
#- [windows-2019, win32]
python: ["cp310", "cp311", "cp312", "cp313"]
runs-on: ${{ matrix.buildplat[0] }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build internal items
run: cd src; make
- name: Setup pandoc for docs build
uses: r-lib/actions/setup-pandoc@v2
- name: Build docs
run: |
pip install ply
pip install numpy
pip install .
pip install pdoc
cd docs; make
- name: Build Package
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
- name: Upload wheels to artifact
uses: actions/upload-artifact@v4
with:
name: cibw-wheel-${{ matrix.buildplat[1] }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
pypi-publish:
name: Upload release to PyPI
needs: [ build_package, build_sdist ]
runs-on: ubuntu-latest
#if: startsWith(github.ref, 'refs/tags/') #only tagged releases
environment:
name: pypi
url: https://pypi.org/p/pycifrw/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheel-*
path: dist
merge-multiple: true
# - uses: actions/download-artifact@v4
# with:
# pattern: cibw-sdist
# path: dist
# merge-multiple: true
- name: check the dist folder
run: ls -R dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
#with:
# repository-url: https://pypi.org/