-
Notifications
You must be signed in to change notification settings - Fork 11
99 lines (84 loc) · 2.88 KB
/
linux.yml
File metadata and controls
99 lines (84 loc) · 2.88 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
name: Linux Build
on:
push:
branches: [ dev, itk_update ]
tags:
- '*'
pull_request:
branches: [ dev ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Print github refs
run: |
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.event.release.tag_name: ${{ github.event.release.tag_name }}"
echo "github.ref: ${{ github.ref }}"
- name: Checkout submodules
run: |
git config --global --add safe.directory /__w/samseg/samseg
git submodule init
git submodule update
- name: Download gcc 10 compilers
run: |
yum install -y gcc-toolset-10
source /opt/rh/gcc-toolset-10/enable
gcc --version
g++ --version
- name: Install CMake 3.31.6 and wget
run: |
yum install -y wget
wget https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-x86_64.sh
chmod +x cmake-3.31.6-linux-x86_64.sh
./cmake-3.31.6-linux-x86_64.sh --prefix=/usr/local --skip-license
ln -s /usr/local/bin/cmake /usr/bin/cmake
cmake --version
- name: Build ITK
run: |
source /opt/rh/gcc-toolset-10/enable
export CC=/opt/rh/gcc-toolset-10/root/usr/bin/gcc
export CXX=/opt/rh/gcc-toolset-10/root/usr/bin/g++
mkdir ITK-build
cd ITK-build
cmake \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=../ITK-install \
../ITK
make install
cd ..
- name: Build samseg and run tests
run: |
source /opt/rh/gcc-toolset-10/enable
export CC=/opt/rh/gcc-toolset-10/root/usr/bin/gcc
export CXX=/opt/rh/gcc-toolset-10/root/usr/bin/g++
.github/workflows/linux_build.sh /opt/python/cp39-cp39/bin/python
.github/workflows/linux_build.sh /opt/python/cp310-cp310/bin/python
.github/workflows/linux_build.sh /opt/python/cp311-cp311/bin/python
.github/workflows/linux_build.sh /opt/python/cp312-cp312/bin/python
ls dist/*.whl | xargs -n1 auditwheel repair
env:
ITK_DIR: ITK-install
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-wheels
path: wheelhouse/*.whl
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags')
run: |
$PYTHON -m pip install twine
$PYTHON -m twine upload wheelhouse/*.whl -u __token__ -p "$PASSWORD"
env:
PASSWORD: ${{ secrets.PYPI_TOKEN }}
PYTHON: /opt/python/cp38-cp38/bin/python