-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (150 loc) · 4.86 KB
/
ci.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
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
name: CI
on:
- push
- pull_request
- workflow_dispatch
jobs:
ci-linux:
runs-on: 'ubuntu-latest'
strategy:
matrix:
include:
- pyversion: 'cp38-cp38'
- pyversion: 'cp39-cp39'
- pyversion: 'cp310-cp310'
- pyversion: 'cp311-cp311'
- pyversion: 'cp312-cp312'
steps:
- uses: actions/checkout@v4
- name: Build packages
env:
IVPM_PYTHON: /opt/python/${{ matrix.pyversion }}/bin/python
BUILD_NUM: ${{ github.run_id }}
run: >
docker run --rm
--volume "$(pwd):/io"
--env IVPM_PYTHON
--env BUILD_NUM
--workdir /io
quay.io/pypa/manylinux2014_x86_64
/io/scripts/build_linux.sh
- name: Publish to PyPi
if: startsWith(github.ref, 'refs/heads/main')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m pip install twine
python3 -m twine upload wheelhouse/*.whl
# ci-linux-docs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2.3.1
# - name: Install Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install python3
# python3 -m pip install ivpm
# python3 -m ivpm update --anonymous-git
# ./packages/python/bin/pip install packaging jinja2
# - name: Build Docs
# run: |
# ./packages/python/bin/python -m sphinx.cmd.build -M html \
# ./doc/source doc/build
# touch doc/build/html/.nojekyll
# - name: Deploy Docs
# if: startsWith(github.ref, 'refs/heads/main')
# uses: JamesIves/github-pages-deploy-action@4.1.7
# with:
# branch: gh-pages
# folder: doc/build/html
ci-windows:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
include:
- platform: windows-latest
build_arch: x64
python_arch: x64
spec: '3.8'
- platform: windows-latest
build_arch: x64
python_arch: x64
spec: '3.9'
- platform: windows-latest
build_arch: x64
python_arch: x64
spec: '3.10'
- platform: windows-latest
build_arch: x64
python_arch: x64
spec: '3.11'
- platform: windows-latest
build_arch: x64
python_arch: x64
spec: '3.12'
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Python ${{ matrix.spec }}
uses: actions/setup-python@v4
with:
architecture: ${{ matrix.python_arch }}
python-version: ${{ matrix.spec }}
- uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: ${{ matrix.build_arch }}
- name: Build/Test Package
env:
BUILD_NUM: ${{ github.run_id }}
run: |
python -m pip install ivpm
python -m ivpm update -a
./packages/python/Scripts/python -m pip install ninja cython setuptools wheel build twine
echo "BUILD_NUM=$env:BUILD_NUM" > python/zsp_parser/__build_num__.py
$env:PYTHONPATH = '$PWD.Path/packages/pyastbuilder/src'
echo "PYTHONPATH: $env:PYTHONPATH"
./packages/python/Scripts/python setup.py build bdist_wheel
- name: Publish to PyPi
if: startsWith(github.ref, 'refs/heads/main')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
./packages/python/Scripts/python -m twine upload dist/*.whl
macos:
runs-on: macos-latest
strategy:
matrix:
include:
- pyversion: '3.8'
- pyversion: '3.9'
- pyversion: '3.10'
- pyversion: '3.11'
- pyversion: '3.12'
steps:
- uses: actions/checkout@v2
- name: Install Python ${{ matrix.pyversion }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
- name: Fetch dependencies
run: |
python3 --version
python3 -m venv py
./py/bin/python3 -m pip install ivpm
./py/bin/python3 -m ivpm update -a
./packages/python/bin/python3 -m pip install cython setuptools wheel build twine
- name: Build wheel
env:
BUILD_NUM: ${{ github.run_id }}
run: |
echo "BUILD_NUM=${BUILD_NUM}" > python/zsp_parser/__build_num__.py
./packages/python/bin/python3 setup.py bdist_wheel
- name: Publish to PyPi
if: startsWith(github.ref, 'refs/heads/main')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
./packages/python/bin/python3 -m twine upload dist/*.whl