Skip to content

build_installers

build_installers #105

name: build_installers
on:
workflow_dispatch:
jobs:
build_intaller:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest] # macos-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__
mamba activate __MICROSAM_BUILD_ENV__
# TODO get the current version here and use it for pinning or enable passing this from dispatch
mamba install -c conda-forge micro_sam
mamba activate base
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: setup conda
if: matrix.os == "windows-latest" || matrix.os == "ubuntu-latest"

Check failure on line 40 in .github/workflows/build_installers.yaml

View workflow run for this annotation

GitHub Actions / build_installers

Invalid workflow file

The workflow is not valid. .github/workflows/build_installers.yaml (Line: 40, Col: 13): Unexpected symbol: '"windows-latest"'. Located at position 14 within expression: matrix.os == "windows-latest" || matrix.os == "ubuntu-latest" .github/workflows/build_installers.yaml (Line: 51, Col: 13): Unexpected symbol: '"windows-latest"'. Located at position 14 within expression: matrix.os == "windows-latest"
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-activate-base: true
activate-environment: ""
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 }}
- 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