forked from computational-cell-analytics/micro-sam
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 3.4 KB
/
build_installers.yaml
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
name: build_installers
on:
workflow_dispatch:
jobs:
build_intaller:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest] # macos-latest , ubuntu-latest
env:
PREPARE_SCRIPT: |
cd deployment
mamba install -y -c conda-forge constructor
mamba install -y -c conda-forge ruamel.yaml
mamba env create --file=../environment_cpu.yaml -n __MICROSAM_BUILD_ENV__
conda activate __MICROSAM_BUILD_ENV__
# TODO get the current version here and use it for pinning or enable passing this from dispatch
mamba install -y -c conda-forge micro_sam
conda activate base
RUN_SCRIPT_WINDOWS: |
python version_getter.py
mkdir ./${{ matrix.os }}_x86_64
constructor --output-dir ./${{ matrix.os }}_x86_64 . --embed-file src/freetype.dll:freetype.dll
RUN_SCRIPT: |
python version_getter.py
mkdir ./${{ matrix.os }}_x86_64
constructor --output-dir ./${{ matrix.os }}_x86_64 .
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
# - name: lint check
# if: matrix.os == 'ubuntu-latest'
# shell: bash -el {0}
# run: |
# bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
# ./actionlint
- name: setup conda
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-activate-base: true
activate-environment: ""
channels: conda-forge
mamba-version: "*"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: build ${{ matrix.os }}_x86_64
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
${{ env.PREPARE_SCRIPT }}
mamba activate sam
mamba install -c anaconda menuinst
python windows_menu_setup.py
conda activate base
${{ env.RUN_SCRIPT_WINDOWS }}
- name: build ${{ matrix.os }}_x86_64
if: matrix.os == 'ubuntu-latest'
shell: bash -el {0}
run: |
${{ env.PREPARE_SCRIPT }}
${{ env.RUN_SCRIPT }}
- name: build ${{ matrix.os }}_x86_64_step1
if: matrix.os == 'macos-latest'
shell: bash -el {0}
run: |
brew install micromamba
/usr/local/opt/micromamba/bin/micromamba shell init -s bash -p ~/micromamba
- name: build ${{ matrix.os }}_x86_64_step2
if: matrix.os == 'macos-latest'
shell: bash -el {0}
run: |
cd deployment
micromamba activate base
micromamba install -y -c conda-forge python=3.10
micromamba install -y -c conda-forge constructor
micromamba install -y -c conda-forge ruamel.yaml
micromamba install -y -c conda-forge mamba
mamba env create --file=env.yaml
python version_getter.py
mkdir ./${{ matrix.os }}_x86_64
constructor --conda-exe=$(which mamba) --output-dir ./${{ matrix.os }}_x86_64 .
- name: upload installer
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_x86_64
path: ./deployment/${{ matrix.os }}_x86_64
retention-days: 5