Skip to content

Commit 65a3b5b

Browse files
committed
deployment: ensure that correct release is pulled for testing
1 parent 0eaaac2 commit 65a3b5b

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ jobs:
7171
- name: Build sdist
7272
run: pipx run build --sdist
7373

74+
- name: Check package
75+
run: |
76+
twine check dist/*.tar.gz
77+
78+
- name: Extract package version
79+
id: extract-version
80+
run: |
81+
SDIST_FILE=$(ls dist/*.tar.gz)
82+
# Extract version from sdist archive (format: mdaencore-1.0.1rc1.tar.gz)
83+
VERSION=$(tar xf ${SDIST_FILE} -O '*/*.egg-info/PKG-INFO' | awk '/^Version:/ {print $2}')
84+
echo "version=$VERSION" >> $GITHUB_OUTPUT
85+
echo "Extracted version: $VERSION"
86+
7487
- name: upload artifacts
7588
if: |
7689
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
@@ -133,7 +146,7 @@ jobs:
133146
name: testpypi check
134147
runs-on: ${{ matrix.os }}
135148
timeout-minutes: 60
136-
needs: upload_testpypi
149+
needs: [upload_testpypi, build_sdist]
137150
strategy:
138151
fail-fast: false
139152
matrix:
@@ -146,9 +159,12 @@ jobs:
146159
with:
147160
python-version: ${{ matrix.python-version }}
148161

149-
- name: pip install
162+
- name: Wait for version to be available on TestPyPI (30 seconds)
163+
run: sleep 30
164+
165+
- name: pip install mdaencore==${{ needs.build_sdist.outputs.version }}
150166
run: |
151-
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mdaencore
167+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "mdaencore==${{ needs.build_sdist.outputs.version }}
152168
153169
- name: install test deps
154170
run: |

0 commit comments

Comments
 (0)