Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenskeiner committed May 31, 2023
2 parents e33334e + 53fd9d7 commit 5e2501a
Show file tree
Hide file tree
Showing 19 changed files with 5,290 additions and 525 deletions.
48 changes: 23 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,59 @@
name: Publish Python distributions to PyPI

on:
workflow_dispatch:
inputs:
ref:
description: 'The git ref to build and publish'
required: true
default: 'main'
type: string
release:
types: [published]

env:
PACKAGE_NAME: exchange_calendars_extensions

jobs:
build-and-publish:
name: Build and publish Python distributions to TestPyPI
name: Build and publish Python distributions to TestPyPI and PyPI.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Install poetry
- name: Install poetry.
run: pipx install poetry
- name: Set up Python 3.10
- name: Set up Python 3.10.
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'
- name: Generate requirements.txt
- name: Set poetry package version from tag.
run: poetry version ${{ github.ref_name }}
- name: Generate requirements.txt.
run: poetry export -f requirements.txt --without-hashes > requirements.txt
- name: Build package
- name: Build package with poetry.
run: poetry build
- name: Publish distribution 📦 to Test PyPI
- name: Publish package 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
- name: Install from testpypi and import.
run: |
i=0
while (($i<12)) && [ "0.1.1" != $(pip index versions -i https://test.pypi.org/simple --pre exchange_calendars_extensions | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
while (($i<36)) && [[ ! $(curl -s https://test.pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -r '.releases | keys[]') =~ (^|[[:space:]])${{ github.ref_name }}($|[[:space:]]) ]];\
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_extensions==0.1.1 --no-deps
pip install --index-url https://test.pypi.org/simple ${{ env.PACKAGE_NAME }}==${{ github.ref_name }} --no-deps
pip install -r requirements.txt
python -c 'import exchange_calendars_extensions;print(exchange_calendars_extensions.__version__)'
python -c 'import ${{ env.PACKAGE_NAME }};print(${{ env.PACKAGE_NAME }}.__version__)'
- name: Clean pip
run: |
pip uninstall -y exchange_calendars_extensions
pip uninstall -y ${{ env.PACKAGE_NAME }}
pip cache purge
- name: Publish distribution 📦 to PyPI
- name: Publish package to PyPI.
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Install and import
- name: Install and import.
run: |
i=0
while (($i<12)) && [ "0.1.1" != $(pip index versions -i https://pypi.org/simple --pre exchange_calendars_extensions | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
while (($i<36)) && [[ ! $(curl -s https://pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -r '.releases | keys[]') =~ (^|[[:space:]])${{ github.ref_name }}($|[[:space:]]) ]];\
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_extensions==0.1.1
python -c 'import exchange_calendars_extensions;print(exchange_calendars_extensions.__version__)'
pip install --index-url https://pypi.org/simple ${{ env.PACKAGE_NAME }}==${{ github.ref_name }}
python -c 'import ${{ env.PACKAGE_NAME }};print(${{ env.PACKAGE_NAME }}.__version__)'
342 changes: 304 additions & 38 deletions README.md

Large diffs are not rendered by default.

Loading

0 comments on commit 5e2501a

Please sign in to comment.