|
| 1 | +name: build_installers |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '**' |
| 7 | + branches: |
| 8 | + - '*' |
| 9 | + |
| 10 | +jobs: |
| 11 | + build_intaller: |
| 12 | + name: ${{ matrix.os }} |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + os: [windows-latest, ubuntu-latest, macos-latest] |
| 19 | + |
| 20 | + env: |
| 21 | + PREPARE_SCRIPT: | |
| 22 | + cd deployment |
| 23 | + conda install -y -c conda-forge constructor |
| 24 | + conda install -y -c conda-forge ruamel.yaml |
| 25 | + conda install -y -c conda-forge mamba |
| 26 | + mamba env create --file=env.yaml |
| 27 | + RUN_SCRIPT: | |
| 28 | + python version_getter.py |
| 29 | + mkdir ./${{ matrix.os }}_x86_64 |
| 30 | + constructor --output-dir ./${{ matrix.os }}_x86_64 . |
| 31 | +
|
| 32 | + steps: |
| 33 | + - name: checkout |
| 34 | + uses: actions/checkout@v3 |
| 35 | + |
| 36 | + - name: setup conda |
| 37 | + if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' |
| 38 | + uses: conda-incubator/setup-miniconda@v2 |
| 39 | + with: |
| 40 | + miniconda-version: "latest" |
| 41 | + auto-activate-base: true |
| 42 | + activate-environment: "" |
| 43 | + env: |
| 44 | + ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
| 45 | + |
| 46 | + - name: build ${{ matrix.os }}_x86_64 |
| 47 | + if: matrix.os == 'windows-latest' |
| 48 | + shell: pwsh |
| 49 | + run: | |
| 50 | + ${{ env.PREPARE_SCRIPT }} |
| 51 | + conda activate __MICROSAM_BUILD_ENV__ |
| 52 | + conda install -c anaconda menuinst |
| 53 | + python windows_menu_setup.py |
| 54 | + conda activate base |
| 55 | + ${{ env.RUN_SCRIPT }} |
| 56 | +
|
| 57 | + - name: build ${{ matrix.os }}_x86_64 |
| 58 | + if: matrix.os == 'ubuntu-latest' |
| 59 | + shell: bash -el {0} |
| 60 | + run: | |
| 61 | + ${{ env.PREPARE_SCRIPT }} |
| 62 | + ${{ env.RUN_SCRIPT }} |
| 63 | +
|
| 64 | + - name: build ${{ matrix.os }}_x86_64_step1 |
| 65 | + if: matrix.os == 'macos-latest' |
| 66 | + shell: bash -el {0} |
| 67 | + run: | |
| 68 | + brew install micromamba |
| 69 | + /usr/local/opt/micromamba/bin/micromamba shell init -s bash -p ~/micromamba |
| 70 | +
|
| 71 | + - name: build ${{ matrix.os }}_x86_64_step2 |
| 72 | + if: matrix.os == 'macos-latest' |
| 73 | + shell: bash -el {0} |
| 74 | + run: | |
| 75 | + cd deployment |
| 76 | + micromamba activate base |
| 77 | + micromamba install -y -c conda-forge python=3.10 |
| 78 | + micromamba install -y -c conda-forge constructor |
| 79 | + micromamba install -y -c conda-forge ruamel.yaml |
| 80 | + micromamba install -y -c conda-forge mamba |
| 81 | + mamba env create --file=env.yaml |
| 82 | + python version_getter.py |
| 83 | + mkdir ./${{ matrix.os }}_x86_64 |
| 84 | + constructor --conda-exe=$(which mamba) --output-dir ./${{ matrix.os }}_x86_64 . |
| 85 | +
|
| 86 | + - name: upload installer |
| 87 | + uses: actions/upload-artifact@v3 |
| 88 | + with: |
| 89 | + name: ${{ matrix.os }}_x86_64 |
| 90 | + path: ./deployment/${{ matrix.os }}_x86_64 |
| 91 | + retention-days: 5 |
0 commit comments