Skip to content

Commit 78641a4

Browse files
committed
Update conda environment and CI workflow: refine dependencies, improve Python setup, and streamline deployment steps
1 parent 7de63ea commit 78641a4

3 files changed

Lines changed: 27 additions & 65 deletions

File tree

.conda/environment.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ channels:
44
- nodefaults
55

66
dependencies:
7-
- anaconda-client
8-
- conda-build
9-
- conda-verify
7+
- python >=3.11
8+
- xarray
9+
- numpy
10+
- dask
11+
- pyyaml
12+
- cftime

.conda/meta.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ build:
1515

1616
requirements:
1717
host:
18-
- python
18+
- python >= 3.11
1919
- pip
20-
- versioneer
2120
run:
2221
- python >=3.11
2322
- xarray
@@ -28,8 +27,7 @@ requirements:
2827

2928
about:
3029
home: https://github.com/ACCESS-NRI/ACCESS-MOPPy
31-
license: Apache Software
32-
license_family: APACHE
30+
license: Apache-2.0
3331
summary: 'ACCESS-MOPPy post-process ACCESS raw model output using CMOR and pre-defined data standards'
3432

3533
extra:

.github/workflows/cd.yml

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,81 +13,43 @@ on:
1313

1414
jobs:
1515
pypi:
16-
name: Build and Deploy to PyPI
16+
name: build and deploy to PyPI
1717
runs-on: ubuntu-latest
1818
permissions:
1919
id-token: write
20-
21-
strategy:
22-
matrix:
23-
python-version: ["3.11", "3.12", "3.13"]
24-
2520
steps:
2621
- name: Checkout source
27-
uses: actions/checkout@v5
28-
29-
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/checkout@v5.0.0
23+
- name: Set up Python 3.11
3024
uses: actions/setup-python@v6
3125
with:
32-
python-version: ${{ matrix.python-version }}
33-
26+
python-version: 3.11
3427
- name: Install build dependencies
3528
run: python -m pip install build twine
36-
3729
- name: Build distributions
30+
shell: bash -l {0}
3831
run: |
3932
git clean -xdf
40-
python -m build --wheel --sdist
41-
42-
- name: Upload artifacts
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: dist-${{ matrix.python-version }}
46-
path: dist/
47-
48-
publish:
49-
name: Publish package to PyPI
50-
needs: pypi
51-
runs-on: ubuntu-latest
52-
permissions:
53-
id-token: write
54-
55-
steps:
56-
- uses: actions/download-artifact@v4
57-
with:
58-
path: dist/
59-
60-
- name: Gather distributions
61-
run: |
62-
mkdir -p dist_flat
63-
find dist -type f \( -name '*.whl' -o -name '*.tar.gz' \) -exec mv {} dist_flat/ \;
64-
rm -rf dist
65-
mv dist_flat dist
66-
ls -l dist
67-
68-
- uses: pypa/gh-action-pypi-publish@release/v1
33+
python -m build
34+
- name: Publish package to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
6936
with:
7037
skip-existing: true
7138

7239
conda:
73-
name: Build and Deploy to Conda
74-
needs: publish
40+
name: build and deploy to conda
41+
needs: pypi
7542
runs-on: ubuntu-latest
76-
77-
strategy:
78-
matrix:
79-
python-version: ["3.11", "3.12", "3.13"]
80-
8143
steps:
8244
- name: Checkout source
83-
uses: actions/checkout@v5
84-
45+
uses: actions/checkout@v5.0.0
8546
- name: Wait for PyPI propagation
8647
run: |
8748
echo "Waiting for PyPI package to be downloadable..."
8849
PACKAGE_NAME="access_moppy"
89-
VERSION=$(python -c "import versioneer; print(versioneer.get_version())")
90-
VERSION=${VERSION#v}
50+
TAG="${GITHUB_REF_NAME}"
51+
VERSION="${TAG#moppy-}"
52+
VERSION="${VERSION#v}"
9153
echo "Looking for package: ${PACKAGE_NAME}==${VERSION}"
9254
for i in {1..90}; do
9355
echo "Attempt $i/90: Trying to download wheel and sdist..."
@@ -112,12 +74,11 @@ jobs:
11274
- name: Setup conda environment
11375
uses: conda-incubator/setup-miniconda@v3
11476
with:
115-
miniconda-version: "latest"
116-
python-version: ${{ matrix.python-version }}
117-
environment-file: .conda/environment.yml
118-
auto-update-conda: false
119-
auto-activate-base: false
120-
77+
auto-activate-base: true
78+
use-mamba: true
79+
- name: Install conda build tools
80+
run: |
81+
mamba install -y conda-build anaconda-client boa
12182
- name: Build and upload the conda package
12283
uses: ACCESS-NRI/action-build-and-upload-conda-packages@d97711bc4445ba5c4de55f5a1bccbd4815286289
12384
with:

0 commit comments

Comments
 (0)