chore(pyproject): force version bump #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Deployment | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: read | |
id-token: write | |
pages: write | |
timeout-minutes: 30 | |
env: | |
POETRY_HTTP_BASIC_SAGACIFY_USERNAME: ${{ secrets.POETRY_HTTP_BASIC_SAGACIFY_USERNAME }} | |
POETRY_HTTP_BASIC_SAGACIFY_PASSWORD: ${{ secrets.POETRY_HTTP_BASIC_SAGACIFY_PASSWORD }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Cache poetry install | |
uses: actions/cache@v2 | |
with: | |
path: ~/.local | |
key: poetry-1.7.1-0 | |
- uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
# Need till this issue is resolved: https://github.com/relekang/python-semantic-release/issues/401 | |
- name: Capture current version | |
id: current_version | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: echo "::set-output name=version::$(poetry version -s)" | |
- name: Python Semantic Release | |
id: semantic_release | |
uses: relekang/[email protected] | |
with: | |
github_token: ${{ secrets.SAGA_GITHUB_TOKEN }} | |
- name: Capture new version | |
id: new_version | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: echo "::set-output name=version::$(poetry version -s)" | |
- name: Build package | |
if: ${{ steps.new_version.outputs.version != steps.current_version.outputs.version }} | |
run: poetry build | |
- name: Push to private PyPI registry | |
if: ${{ steps.new_version.outputs.version != steps.current_version.outputs.version }} | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }} | |
run: | | |
poetry config pypi-token.pypi ${POETRY_PYPI_TOKEN_PYPI} | |
poetry publish | |
- name: Install packages & build | |
run: | | |
poetry install --with docs | |
- name: Build documentation | |
working-directory: docs | |
run: | | |
poetry run sphinx-build -b html . _build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'docs/_build' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 |