-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (79 loc) · 3.84 KB
/
build.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
on:
workflow_dispatch:
inputs:
PACKAGE_DIR:
description: "set package dir to build and archive your package"
required: true
jobs:
build:
name: 🛠️ build on ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04, macos-12, macos-13-xlarge] # windows-2022] windows is a bit sad :'(
runs-on: ${{ matrix.platform }}
# set bash to be a login shell, so that /etc/profile is sourced and conda
# works
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
# it might be worth switching to micromamba instead someday
# https://mamba.readthedocs.io/en/latest/installation.html#micromamba
- name: Install mambaforge
run: |
wget -q -O Mambaforge.sh "https://github.com/conda-forge/miniforge/releases/download/23.3.1-1/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge.sh -b -p "${HOME}/mambaforge" > /dev/null
# very trashy- shove in the conda init crap into /etc/profile.
# /etc/profile on mac doesn't auto-source /etc/profile.d files, so add
# them explicitly
echo source "${HOME}/mambaforge/etc/profile.d/conda.sh" | sudo tee -a /etc/profile
echo source "${HOME}/mambaforge/etc/profile.d/mamba.sh" | sudo tee -a /etc/profile
echo 'mamba activate base' | sudo tee -a /etc/profile
- name: Mamba info
run: mamba info
- name: Install mambabuild
run: |
# install mambabuild for faster builds
mamba install --yes --channel conda-forge boa==0.15.1
- name: Set conda config values
run: |
conda config --set conda_build.pkg_format 2
conda config --set conda_build.zstd_compression_level 19
conda config --show
# Conda build relies on using the 'file' protocol when manipulating
# submodules that use a _relative_ ref (eg `../foo`), but this breaks due
# to a recent patch to git for a CVE. This workaround is required right
# now.
#
# https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html
- name: Work around git CVE fix
run: |
git config --global protocol.file.allow always
# Untested, but might improve reliability of the build
# # Explicitly override the xcode version for macos-11
# - uses: maxim-lobanov/setup-xcode@v1
# # only if matrix.platform == macos-11
# if: matrix.platform == 'macos-11'
# with:
# # list from here:
# # https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md#installed-sdks
# xcode-version: "11.7"
- name: Build package
run: |
# mac-only, we need to inject the macos sdk so conda can link against it
# https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md
if command -v xcode-select; then
export MACOSX_DEPLOYMENT_TARGET="10.15"
export CONDA_BUILD_SYSROOT="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${MACOSX_DEPLOYMENT_TARGET}.sdk"
echo mac sysroot: ${CONDA_BUILD_SYSROOT}
fi
# store the output in an out of tree location
mkdir -p ${{ github.event.inputs.PACKAGE_DIR }}.${{ matrix.platform }}.output
conda mambabuild -c conda-forge --output-folder ${{ github.event.inputs.PACKAGE_DIR }}.${{ matrix.platform }}.output ${{ github.event.inputs.PACKAGE_DIR }}
# upload-artifact to save the output files
- uses: actions/upload-artifact@v3
with:
name: ${{ github.event.inputs.PACKAGE_DIR }}.${{ matrix.platform }}.package
path: ${{ github.event.inputs.PACKAGE_DIR }}.${{ matrix.platform }}.output