forked from raidionics/Raidionics
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (87 loc) · 2.81 KB
/
build_macos_m1.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
name: Build macOS M1
on:
# Allows to run the workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build packages
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- name: Collect submodules
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create environment and install python packages
run: |
cd ${{github.workspace}}
mkdir tmp
cd tmp
python3 -m virtualenv -p python3 venv --clear
source venv/bin/activate
python3 -m pip install wheel setuptools
deactivate
- name: Install dependencies
run: |
cd ${{github.workspace}}
source tmp/venv/bin/activate
python3 -m pip install --upgrade pip
pip3 install matplotlib
pip3 install -r assets/requirements.txt
deactivate
# - name: Install cmake
# run: |
# brew update
# brew install cmake ninja
# ninja --version
# cmake --version
#
# - name: Build ANTs
# run: |
# cd ${{github.workspace}}
# mkdir ANTs
# cd ANTs
# git clone https://github.com/ANTsX/ANTs.git source
# mkdir build
# cd build
# cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ANTs/install ../source
# make -j4
# cd ANTS-build
# make install
# cp -R ${{github.workspace}}/ANTs/source/Scripts ${{github.workspace}}/ANTs/install/
- name: Download ANTs
uses: robinraju/release-downloader@main
with:
repository: "raidionics/Raidionics-dependencies"
latest: true
fileName: "ANTsX-v2.4.3_macos_arm.tar.gz"
out-file-path: "downloads"
- name: Extract ANTs
run: |
cd ${{github.workspace}}/downloads/
tar -xzf ANTsX-v2.4.3_macos_arm.tar.gz -C ${{github.workspace}}/downloads/
mkdir ${{github.workspace}}/ANTs
mv ${{github.workspace}}/downloads/install ${{github.workspace}}/ANTs/
- name: Build software
run: |
cd ${{github.workspace}}
source tmp/venv/bin/activate
pip3 install pyinstaller==5.0
pip3 install --upgrade PyInstaller pyinstaller-hooks-contrib
mkdir tmp_dependencies
pyinstaller --log-level DEBUG --noconfirm --clean assets/main_arm.spec
- name: Make installer
run: |
git clone https://github.com/dbouget/quickpkg.git
quickpkg/quickpkg dist/Raidionics.app --output Raidionics-1.2.0-macOS.pkg
cp -r Raidionics-1.2.0-macOS.pkg dist/Raidionics-1.2.0-macOS.pkg
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: Package
path: ${{github.workspace}}/dist/Raidionics-*
if-no-files-found: error
- name: Cleanup
if: always()
run: |
rm -rf ${{github.workspace}}/tmp/