Skip to content

Commit

Permalink
Update release workflow (#237)
Browse files Browse the repository at this point in the history
* Update release workflow

- Attempts fix for install and import checks (#207).
- Revises to wait for newly released version to appear in pip index before
attempting to install.
  • Loading branch information
maread99 authored Oct 4, 2022
1 parent 568cbeb commit baa1adb
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
python-version: "3.10"

- name: Install dependencies
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
Expand All @@ -30,22 +30,30 @@ jobs:
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Install from test and test running
- name: Install from testpypi and import
run: |
echo "Will wait 10s" && sleep 10s
# pip install --extra-index-url https://test.pypi.org/simple exchange_calendars==${{ github.ref_name }}
# python -c 'import exchange_calendars;print(exchange_calendars.__version__)'
# pip uninstall -y exchange_calendars
i=0
while (($i<12)) && [ "${{ github.ref_name }}" != $(pip index versions -i https://test.pypi.org/simple --pre exchange_calendars | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo waiting for package to appear in test index, sleeping 5s; sleep 5s; let i++; done
pip install --index-url https://test.pypi.org/simple exchange_calendars==${{ github.ref_name }} --no-deps
pip install -r etc/requirements.txt
python -c 'import exchange_calendars;print(exchange_calendars.__version__)'
- name: Clean pip
run: |
pip uninstall -y exchange_calendars
pip cache purge
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Install and test running
- name: Install and import
run: |
pip cache purge
echo "Will wait 10s" && sleep 10s
# pip install --index-url https://pypi.org/simple exchange_calendars==${{ github.ref_name }}
# python -c 'import exchange_calendars;print(exchange_calendars.__version__)'
i=0
while (($i<12)) && [ "${{ github.ref_name }}" != $(pip index versions -i https://pypi.org/simple --pre exchange_calendars | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo waiting for package to appear in index, sleeping 5s; sleep 5s; let i++; done
pip install --index-url https://pypi.org/simple exchange_calendars==${{ github.ref_name }}
python -c 'import exchange_calendars;print(exchange_calendars.__version__)'

0 comments on commit baa1adb

Please sign in to comment.