-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (165 loc) · 5.27 KB
/
Copy pathrelease.yml
File metadata and controls
178 lines (165 loc) · 5.27 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Release to PyPI and Publish Documentation
on:
workflow_run:
workflows: ["CI Tests"]
branches: [main]
types: [completed]
workflow_dispatch:
jobs:
check-tag-existance:
name: "Check if tag exists"
runs-on: ubuntu-latest
outputs:
exists: ${{ steps.check-tag.outputs.exists }}
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v6
- name: "Get PYCAPIO version"
id: get-version
run: |
VERSION=$(grep -E 'VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | awk '{print $2}')
echo "PYCAPIO_VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: "Check if tag exists"
id: check-tag
uses: mukunku/tag-exists-action@v1.7.0
with:
tag: "v${{ env.PYCAPIO_VERSION }}"
build-wheels:
name: Build wheels on ${{ matrix.os }}
needs: check-tag-existance
if: needs.check-tag-existance.outputs.exists == 'false'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04', 'ubuntu-24.04-arm']
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install --upgrade cibuildwheel
- name: Build wheels
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_SKIP: "*-musllinux_*"
MACOSX_DEPLOYMENT_TARGET: "15.0"
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: >
dnf install -y openmpi-devel
CIBW_ENVIRONMENT_LINUX: 'PATH="/usr/lib64/openmpi/bin:$PATH"'
run: cibuildwheel --output-dir wheelhouse
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
build-sdist:
name: Build source distribution
needs: check-tag-existance
if: needs.check-tag-existance.outputs.exists == 'false'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Build sdist
run: |
python -m pip install --upgrade build
python -m build --sdist
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
publish:
name: Release and Publish to PyPI
needs: [check-tag-existance, build-wheels, build-sdist]
if: needs.check-tag-existance.outputs.exists == 'false'
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating GitHub Releases
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Download all wheels
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ needs.check-tag-existance.outputs.version }}"
name: "v${{ needs.check-tag-existance.outputs.version }}"
generate_release_notes: true
files: dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_DEPLOY_KEY }}
run: |
python -m pip install --upgrade twine
twine check dist/*
twine upload dist/*
build-docs:
name: Build documentation
needs: [check-tag-existance]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y doxygen
- name: Install documentation dependencies
run: pip install -r docs/requirements.txt
- name: Build HTML
run: make -C docs html
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/_build/html
deploy-docs:
name: Deploy documentation
needs: [ build-docs, publish ]
if: needs.check-tag-existance.outputs.exists == 'false'
runs-on: ubuntu-24.04
concurrency:
group: docs-deploy
cancel-in-progress: false
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v4
with:
name: documentation
path: site
- name: "Deploy documentation page"
uses: appleboy/scp-action@v1.0.0
with:
host: capio.hpc4ai.it
username: capio-user
key: ${{ secrets.PYCAPIO_DOC_DEPLOY_KEY }}
rm: true
source: "site/*"
strip_components: 1
target: /mnt/services/capio/nginx/html/pycapio