Skip to content

Commit ec41530

Browse files
committed
Build and publish the esmvalcore package to conda via Github Actions workflow (#825)
1 parent 588f5a3 commit ec41530

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Anaconda Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
# use this to test before actual release and publish
7+
# push:
8+
# branches:
9+
# - some_test_branch
10+
11+
jobs:
12+
13+
publish:
14+
name: publish / python-3.8 / ubuntu-latest
15+
runs-on: 'ubuntu-latest'
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: goanpeca/setup-miniconda@v1
19+
with:
20+
auto-update-conda: true
21+
python-version: "3.8"
22+
miniconda-version: "latest"
23+
channels: conda-forge
24+
- name: Show conda config
25+
shell: bash -l {0}
26+
run: |
27+
conda info
28+
conda list
29+
conda config --show-sources
30+
conda config --show
31+
- name: Python info
32+
shell: bash -l {0}
33+
run: |
34+
which python
35+
python --version
36+
- name: Install build dependencies
37+
shell: bash -l {0}
38+
run: conda install -y conda-build conda-verify ripgrep anaconda-client
39+
- name: Build the conda package
40+
shell: bash -l {0}
41+
run: |
42+
conda config --set anaconda_upload no
43+
export BUILD_FOLDER=/tmp/esmvalcore/_build
44+
mkdir -p $BUILD_FOLDER
45+
conda build package \
46+
--channel esmvalgroup --channel conda-forge \
47+
--croot $BUILD_FOLDER \
48+
- name: Push the package to anaconda cloud
49+
shell: bash -l {0}
50+
run: |
51+
export BUILD_FOLDER=/tmp/esmvalcore/_build
52+
# use --label test before actual release and check all works well
53+
anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload --user esmvalgroup $BUILD_FOLDER/noarch/*.tar.bz2
54+
verify:
55+
name: verify / python-${{ matrix.python-version }} / ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
os: ['ubuntu-latest'] # may extent to osx in the future
60+
python-version: ["3.6", "3.7", "3.8"]
61+
runs-on: ${{ matrix.os }}
62+
needs: publish
63+
steps:
64+
- uses: actions/checkout@v2
65+
with:
66+
fetch-depth: "0"
67+
- uses: goanpeca/setup-miniconda@v1
68+
with:
69+
python-version: ${{ matrix.python-version }}
70+
miniconda-version: "latest"
71+
channels: esmvalgroup,conda-forge
72+
- shell: bash -l {0}
73+
run: conda --version
74+
- shell: bash -l {0}
75+
run: which conda
76+
- shell: bash -l {0}
77+
run: python -V
78+
- shell: bash -l {0}
79+
run: conda install esmvalcore
80+
- shell: bash -l {0}
81+
run: esmvaltool --help
82+
- shell: bash -l {0}
83+
run: esmvaltool version

doc/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Improvements
4444
- Update CMIP6 tables to 6.9.32 (`#706 <https://github.com/ESMValGroup/ESMValCore/pull/706>`__) `Javier Vegas-Regidor <https://github.com/jvegasbsc>`__
4545
- Default config-user path now set in config-user read function (`#791 <https://github.com/ESMValGroup/ESMValCore/pull/791>`__) `Javier Vegas-Regidor <https://github.com/jvegasbsc>`__
4646
- Add custom variable lweGrace (`#692 <https://github.com/ESMValGroup/ESMValCore/pull/692>`__) `bascrezee <https://github.com/bascrezee>`__
47+
- Create Github Actions workflow to build and deploy on Test PyPi and PyPi (`#820 <https://github.com/ESMValGroup/ESMValCore/pull/820>`__) `Valeriu Predoi <https://github.com/valeriupredoi>`__
48+
- Build and publish the esmvalcore package to conda via Github Actions workflow (`#825 <https://github.com/ESMValGroup/ESMValCore/pull/825>`__) `Valeriu Predoi <https://github.com/valeriupredoi>`__
4749

4850
Fixes for datasets
4951
~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)