-
Notifications
You must be signed in to change notification settings - Fork 26
105 lines (93 loc) · 3.43 KB
/
package.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
96
97
98
99
100
101
102
103
104
105
name: conda-package
on:
push:
branches: [ master ]
tags: ["*"]
pull_request:
branches: [ master ]
jobs:
package:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Linux",
os: ubuntu-latest
}
- {
name: "MacOSX",
os: macos-latest
}
- {
name: "Windows",
os: windows-2019
}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
activate-environment: hexrd
auto-activate-base: false
- name: Install build requirements
run: |
# Change default solver to be libmamba, so that it runs much faster
conda install -n base -c conda-forge conda-libmamba-solver
conda config --set solver libmamba
conda activate hexrd
# FIXME: downgrade urllib3 until this issue is fixed:
# https://github.com/Anaconda-Platform/anaconda-client/issues/654
conda install --override-channels -c conda-forge anaconda-client conda-build conda 'urllib3<2.0.0'
# This is need to ensure ~/.profile or ~/.bashrc are used so the activate
# command works.
shell: bash -l {0}
- name: Build the package (host)
if: ${{ matrix.config.name != 'Linux' }}
run: |
conda activate hexrd
mkdir output
# Conda build is ignoring the .condarc for some reason, so we need to
# set this environment variable instead.
export CONDA_SOLVER=libmamba
CONDA_SOLVER=libmamba conda build --override-channels -c conda-forge --output-folder output/ conda.recipe/
# This is need to ensure ~/.profile or ~/.bashrc are used so the activate
# command works.
shell: bash -l {0}
- name: Build the package (container)
if: ${{ matrix.config.name == 'Linux' }}
uses: docker://centos:7
with:
entrypoint: /github/workspace/.github/workflows/container_build.sh
- name: Upload the package to anaconda channel (tag push to master)
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: |
conda activate hexrd
anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload --force --user HEXRD output/**/*.tar.bz2
# This is need to ensure ~/.profile or ~/.bashrc are used so the activate
# command works.
shell: bash -l {0}
- name: Upload the package to anaconda prerelease channel (upload push to master)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
conda activate hexrd
anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload --force --user HEXRD --label hexrd-prerelease output/**/*.tar.bz2
# This is need to ensure ~/.profile or ~/.bashrc are used so the activate
# command works.
shell: bash -l {0}
- name: Get version for the artifact names
run: echo "HEXRD_GIT_DESCRIBE=$(git describe --tag)" >> $GITHUB_ENV
- name: Upload the package to github
uses: actions/upload-artifact@v2
with:
name: HEXRD-${{ matrix.config.name }}-${{ env.HEXRD_GIT_DESCRIBE }}.tar.bz2
path: output/**/*.tar.bz2