Skip to content

Adds support for inflation expectations and futures exchanges endpoin… #91

Adds support for inflation expectations and futures exchanges endpoin…

Adds support for inflation expectations and futures exchanges endpoin… #91

Workflow file for this run

name: release
on:
push:
tags:
- v*
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
name: Release to PyPi
steps:
- uses: actions/checkout@v3
- name: Fetch all branches
run: git fetch --prune --unshallow
- name: Check if commit is on allowed branch
run: |
if git branch -r --contains ${{ github.sha }} | grep -Eq 'origin/master|origin/polygon-lts'; then
echo "Allowed branch"
else
echo "Commit not on master or polygon-lts; skipping"
exit 1
fi
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
- name: Get package name
id: package
run: |
echo "name=$(python - <<'PY'
import sys
with open('pyproject.toml', 'r', encoding='utf-8') as f:
for line in f:
s = line.strip()
if s.startswith('name'):
# supports: name="foo" or name = "foo" and ignores inline comments
val = s.split('=', 1)[1].split('#', 1)[0].strip().strip('"').strip("'")
print(val)
break
PY
)" >> "$GITHUB_OUTPUT"
- name: Configure Poetry
run: |
if [ "${{ steps.package.outputs.name }}" = "polygon-api-client" ]; then
poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }}
elif [ "${{ steps.package.outputs.name }}" = "massive" ]; then
poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD_MASSIVE }}
else
echo "Unknown package name: ${{ steps.package.outputs.name }}; skipping publish"
exit 1
fi
- name: Install deps
run: poetry install
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Version according to tag
run: poetry version ${{ steps.tag.outputs.tag }}
- name: Build
run: poetry build
- name: Publish to PyPi
run: poetry publish