-
Notifications
You must be signed in to change notification settings - Fork 11
78 lines (76 loc) · 2.87 KB
/
main.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
name: Release Main
# Note that push and pull-request builds are automatically
# now skipped by GitHub if
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.
# Only allow this action to run on a manual run.
# We should specify when run whether or not we want
# to upload the packages at the end. We may not want to,
# as we need to wait for a major or patch release
on:
workflow_dispatch:
inputs:
upload_packages:
description: "Upload packages to anaconda (yes/no)?"
required: true
default: "no"
jobs:
build:
name: build (${{ matrix.python-version }}, ${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
platform:
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
- { name: "macos", os: "macos-latest", shell: "bash -l {0}" }
environment:
name: sire-build
defaults:
run:
shell: ${{ matrix.platform.shell }}
env:
SIRE_DONT_PHONEHOME: 1
SIRE_SILENT_PHONEHOME: 1
REPO: "${{ github.event.pull_request.head.repo.full_name || github.repository }}"
steps:
# Need to install and use VS 2017 for conda-compliant builds
- name: Set up Visual Studio 2017 Build Tools (required for Python modules)
run: |
choco install visualstudio2017-workload-vctools
if: matrix.platform.name == 'windows'
#
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the main branch (push to main)
run: git clone -b main https://github.com/openbiosim/sire sire
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging=21 pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
#
- name: Upload Conda package
# upload to the 'test' channel
run: python ${{ github.workspace }}/sire/actions/upload_package.py test
env:
SRC_DIR: ${{ github.workspace }}/sire
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: github.event.inputs.upload_packages == 'yes'