1313
1414jobs :
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