Skip to content

4.8 🌈

4.8 🌈 #42

Workflow file for this run

name: Publish Python 🐍 distributions πŸ“¦ to PyPI
on:
release:
types: [published]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish distribution πŸ“¦ to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Install from testpypi and import
shell: bash
run: |
sleep 5
while [ "${{ 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; echo "woken up"; 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 import
shell: bash
run: |
sleep 5
while [ "${{ 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; echo "woken up"; done
pip install --index-url https://pypi.org/simple exchange_calendars==${{ github.ref_name }}
python -c 'import exchange_calendars;print(exchange_calendars.__version__)'