-
Notifications
You must be signed in to change notification settings - Fork 286
199 lines (168 loc) · 6.76 KB
/
bundles.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: generate bundles
on: [push]
jobs:
build-win:
name: build windows packages
runs-on: windows-latest
strategy:
matrix:
architecture: ['x64']
ai_ready: [0, 1]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Put current date into a variable
run: |
$DATE=& Get-Date -format yyyy-MM-dd
echo "DATE=$DATE" >> $env:GITHUB_ENV
- name: Put current commit hash in a variable
run: |
$COMMIT=$(git rev-parse HEAD)
echo "COMMIT=$COMMIT" >> $env:GITHUB_ENV
- name: Setup VC++ 2022 (17.0)
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
vsversion: '17.0'
arch: ${{ matrix.architecture }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11.2'
cache: 'pip'
- name: Upgrade pip and enable wheel support
run: python -m pip install --upgrade pip setuptools wheel
- name: Install InVesalius requirements
run: pip install -r requirements.txt
- name: Install Pytorch + Cuda 11.8 (only ai-ready build)
if: ${{ matrix.ai_ready == 1}}
run: pip install torch==2.3.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
- name: Compile InVesalius Cython parts
run: |
python3 setup.py build_ext --inplace
python3 setup.py build_plugins
- name: Insert version and commit hash into dialog.py
run: python3 bundle_tools/win/insert_version_date.py ./invesalius/gui/dialogs.py ${{ env.DATE }} ${{ env.COMMIT }} nightly
- uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9
id: pyinstaller
name: Download pyinstaller
with:
url: "https://github.com/pyinstaller/pyinstaller/archive/refs/tags/v6.9.0.zip"
target: ./pyinstaller/
- name: Extract pyinstaller file
uses: ihiroky/extract-action@v1
with:
file_path: ./pyinstaller/v6.9.0.zip
extract_dir: ./pyinstaller/
- name: Compile pyinstaller bootloader
run: |
cd ./pyinstaller/pyinstaller-6.9.0/bootloader/
python3 ./waf distclean all
cd ..
pip install .
- name: Download mandible ai weight
if: ${{ matrix.ai_ready == 1 }}
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9
with:
url: "https://raw.githubusercontent.com/invesalius/weights/main/mandible_ct/mandible_jit_ct.pt"
target: ./ai/mandible_jit_ct/
- name: Download cranioplasty binary ai weight
if: ${{ matrix.ai_ready == 1 }}
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9
with:
url: "https://raw.githubusercontent.com/invesalius/weights/main/cranioplasty_jit_ct_binary/cranioplasty_jit_ct_binary.pt"
target: ./ai/cranioplasty_jit_ct_binary/
- name: Download cranioplasty gray ai weight
if: ${{ matrix.ai_ready == 1 }}
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9
with:
url: "https://raw.githubusercontent.com/invesalius/weights/main/cranioplasty_jit_ct_gray/cranioplasty_jit_ct_gray.pt"
target: ./ai/cranioplasty_jit_ct_gray/
- name: Download trachea ai weight
if: ${{ matrix.ai_ready == 1 }}
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9
with:
url: "https://github.com/tfmoraes/deep_trachea_torch/releases/download/v1.0/weights.pt"
target: ./ai/trachea_ct/
- name: Fix trachea name ai weight
if: ${{ matrix.ai_ready == 1 }}
run: |
move ./ai/trachea_ct/weights.pt ./ai/trachea_ct/trachea_ct.pt
- name: Download brain ai weight
if: ${{ matrix.ai_ready == 1 }}
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9
with:
url: "https://github.com/tfmoraes/deepbrain_torch/releases/download/v1.1.0/weights.pt"
target: ./ai/brain_mri_t1/
- name: Fix brain name ai weight
if: ${{ matrix.ai_ready == 1 }}
run: |
move ./ai/brain_mri_t1/weights.pt ./ai/brain_mri_t1/brain_mri_t1.pt
- name: Generate InVesalius .exe file
run: |
cp ./bundle_tools/win/app.spec ./
pyinstaller app.spec --clean --noconfirm
mkdir installer
- name: Generate InVesalius installer - win64 ai-ready build
if: ${{ matrix.ai_ready == 1 }}
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: ./bundle_tools/win/generate_installer.iss
options: /F"invesalius-3.1_nightly_ai-ready_win64"
- name: Generate InVesalius installer - win64 normal build
if: ${{ matrix.ai_ready == 0}}
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: ./bundle_tools/win/generate_installer.iss
options: /F"invesalius-3.1_nightly_win64"
- name: Show files
run: |
cd ./installer
dir
- name: Upload artifact of package normal file
if: ${{ matrix.ai_ready == 0}}
uses: actions/upload-artifact@v4
with:
overwrite: true
name: invesalius_package_exe_normal
retention-days: 2
path: ./installer/*.exe
- name: Upload artifact of package ai-ready file
if: ${{ matrix.ai_ready == 1}}
uses: actions/upload-artifact@v4
with:
overwrite: true
name: invesalius_package_exe_ai-ready
retention-days: 2
path: ./installer/*.exe
publish_packages:
name: publish packages
needs: build-win
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v4
with:
name: invesalius_package_exe_normal
path: ./
- uses: actions/download-artifact@v4
with:
name: invesalius_package_exe_ai-ready
path: ./
- name: Message
run: |
dir
- name: Update Nightly Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly'
draft: false
prerelease: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.is-pre-release) || (github.event_name == 'schedule')}}
body: |
This is a nightly release InVesalius.
It's unstable compared to the official releases, **use it with caution**!
files: |
./invesalius-3.1_nightly_ai-ready_win64.exe
./invesalius-3.1_nightly_win64.exe