Skip to content

Commit 158d2c0

Browse files
committed
adding github action for conda builds
1 parent 4034ac4 commit 158d2c0

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build Conda packages
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-conda:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, windows-latest]
12+
python-version: ["3.11"]
13+
toolchain:
14+
- {compiler: intel-classic, version: '2021.12'}
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0 # Shallow clones should be disabled for versioneer
21+
fetch-tags: true # Required for versioneer
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Set up Conda environment (Linux/Windows)
29+
uses: conda-incubator/setup-miniconda@v3
30+
with:
31+
activate-environment: build-env
32+
channels: conda-forge
33+
python-version: ${{ matrix.python-version }}
34+
auto-update-conda: true
35+
mamba-version: "*"
36+
37+
- name: Install dependencies (Linux/Windows)
38+
run: |
39+
conda install -y conda-build numpy anaconda-client versioneer
40+
41+
- name: Install ifort dependencies (Windows)
42+
if: matrix.os == 'windows-latest'
43+
uses: fortran-lang/setup-fortran@v1
44+
id: setup-fortran
45+
with:
46+
compiler: ${{ matrix.toolchain.compiler }}
47+
version: ${{ matrix.toolchain.version }}
48+
49+
- name: Verify ifort environment (Windows)
50+
if: matrix.os == 'windows-latest'
51+
run: |
52+
echo "Setting up Fortran environment"
53+
${{ steps.setup-fortran.outputs.fc }} /help
54+
55+
- name: Build Conda package on Ubuntu
56+
if: matrix.os == 'ubuntu-latest'
57+
env:
58+
ANACONDA_CHANNEL_UPLOAD_TOKEN: ${{ secrets.ANACONDA_CHANNEL_UPLOAD_TOKEN }}
59+
run: |
60+
echo "Building Conda package"
61+
conda config --set anaconda_upload yes
62+
conda build -c conda-forge -c cadwr-dms --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" .
63+
64+
- name: Build Conda package on Windows
65+
if: matrix.os == 'windows-latest'
66+
env:
67+
ANACONDA_CHANNEL_UPLOAD_TOKEN: ${{ secrets.ANACONDA_CHANNEL_UPLOAD_TOKEN }}
68+
run: |
69+
echo "Building Conda package"
70+
conda config --set anaconda_upload yes
71+
conda build -c conda-forge -c cadwr-dms --user cadwr-dms --token "$env:ANACONDA_CHANNEL_UPLOAD_TOKEN" .

0 commit comments

Comments
 (0)