77 workflow_dispatch :
88 inputs :
99 version :
10- description : ' Version to publish (e.g. 2.3.0a9)'
10+ description : ' Version to update to (e.g. 2.3.0a9)'
1111 required : false
1212 type : string
1313
1414jobs :
1515 pypi :
16- name : Build & Deploy to PyPI
16+ name : build and deploy to PyPI
1717 runs-on : ubuntu-latest
1818 permissions :
1919 id-token : write
20-
2120 steps :
22- - name : Checkout
23- uses : actions/checkout@v6.0.0
24-
25- - name : Set up Python
21+ - name : Checkout source
22+ uses : actions/checkout@v5.0.0
23+ - name : Set up Python 3.11
2624 uses : actions/setup-python@v6
2725 with :
28- python-version : ' 3.11'
29-
30- - name : Install build tooling
31- run : python -m pip install --upgrade pip build twine
32-
26+ python-version : 3.11
27+ - name : Install build dependencies
28+ run : python -m pip install build twine
3329 - name : Build distributions
30+ shell : bash -l {0}
3431 run : |
3532 git clean -xdf
36- python -m build
37-
38- - name : Publish to PyPI
33+ pyproject-build
34+ - name : Publish package to PyPI
3935 uses : pypa/gh-action-pypi-publish@release/v1
4036 with :
4137 skip-existing : true
4238
4339 conda :
44- name : Build & Deploy to Conda
40+ name : build and deploy to conda
4541 needs : pypi
4642 runs-on : ubuntu-latest
47- env :
48- PACKAGE : access_moppy
49-
5043 steps :
51- - name : Checkout
52- uses : actions/checkout@v6.0.0
53-
54- - name : Derive Version
55- id : ver
56- run : |
57- tag="${GITHUB_REF_NAME}"
58- ver="${tag#moppy-}"
59- ver="${ver#v}"
60- echo "version=$ver" >> $GITHUB_OUTPUT
61-
62- - name : Wait for PyPI availability (fast check)
63- env :
64- VER : ${{ steps.ver.outputs.version }}
44+ - name : Checkout source
45+ uses : actions/checkout@v5.0.0
46+ - name : Wait for PyPI propagation
6547 run : |
66- echo "Checking PyPI for $PACKAGE==$VER..."
67- for i in {1..60}; do
68- if curl -sf https://pypi.org/pypi/$PACKAGE/$VER/json > /dev/null; then
69- echo "🟢 Found $PACKAGE==$VER on PyPI"
70- exit 0
48+ echo "Waiting for PyPI package to be downloadable..."
49+ PACKAGE_NAME="access_moppy"
50+ VERSION=$(python -c "import versioneer; print(versioneer.get_version())")
51+ VERSION=${VERSION#v}
52+ echo "Looking for package: ${PACKAGE_NAME}==${VERSION}"
53+ for i in {1..90}; do
54+ echo "Attempt $i/90: Trying to download wheel and sdist..."
55+ rm -rf /tmp/pypi_check_download && mkdir -p /tmp/pypi_check_download
56+ pip download --no-deps --dest /tmp/pypi_check_download ${PACKAGE_NAME}==${VERSION} >/dev/null 2>&1
57+ pip download --no-deps --no-binary=:all: --dest /tmp/pypi_check_download ${PACKAGE_NAME}==${VERSION} >/dev/null 2>&1
58+ WHEEL=$(ls /tmp/pypi_check_download/*.whl 2>/dev/null | head -1)
59+ SDIST=$(ls /tmp/pypi_check_download/*.tar.gz 2>/dev/null | head -1)
60+ if [[ -n "$WHEEL" && -n "$SDIST" ]]; then
61+ echo "✅ Both wheel and sdist for ${PACKAGE_NAME}==${VERSION} are downloadable!"
62+ break
63+ fi
64+ if [ $i -eq 90 ]; then
65+ echo "❌ Could not download both wheel and sdist after 15 minutes"
66+ echo "Available files:"
67+ ls -l /tmp/pypi_check_download || echo "No files downloaded"
68+ exit 1
7169 fi
72- echo "Waiting ... $i/60 "
70+ echo "Files not yet downloadable, waiting 10 seconds ..."
7371 sleep 10
7472 done
75- echo "❌ Timeout waiting for $PACKAGE==$VER on PyPI"
76- exit 1
77-
78- - name : Setup conda
73+ - name : Setup conda environment
7974 uses : conda-incubator/setup-miniconda@v3
8075 with :
76+ miniconda-version : " latest"
8177 python-version : 3.11
8278 environment-file : .conda/environment.yml
8379 auto-update-conda : false
8480 auto-activate-base : false
8581 show-channel-urls : true
86-
87- - name : Build & Upload to Conda
88- uses : ACCESS-NRI/action-build-and-upload-conda-packages@v3.0.0
82+ - name : Build and upload the conda package
83+ uses : ACCESS-NRI/action-build-and-upload-conda-packages@d97711bc4445ba5c4de55f5a1bccbd4815286289
8984 with :
9085 meta_yaml_dir : .conda
9186 upload : true
9287 user : accessnri
9388 label : main
94- token : ${{ secrets.ANACONDA_TOKEN }}
89+ token : ${{ secrets.anaconda_token }}
9590
9691 update_analysis3 :
97- name : Update access-moppy in Analysis3
92+ name : Update ACCESS-MOPPy on Analysis3 Conda Environment
9893 needs : conda
9994 runs-on : ubuntu-latest
10095 permissions :
@@ -106,9 +101,9 @@ jobs:
106101 FILE_PATH : environments/analysis3/environment.yml
107102 PACKAGE : access-moppy
108103 CHANNEL : accessnri
109- GH_TOKEN : ${{ secrets.GH_ANALYSIS3_DEPLOY }}
110- INPUT_VERSION : ${{ github.event.inputs.version }}
111104 RELEASE_TAG : ${{ github.ref_name }}
105+ INPUT_VERSION : ${{ github.event.inputs.version }}
106+ GH_TOKEN : ${{ secrets.GH_ANALYSIS3_DEPLOY }}
112107 steps :
113108 - name : Derive version string
114109 id : ver
0 commit comments