Skip to content

v0.9.2

v0.9.2 #25

Workflow file for this run

name: Publish package and docs
on:
release:
types:
- published
workflow_dispatch:
inputs:
reason:
description: Why did you trigger the pipeline?
required: False
default: Check if it runs again due to external changes
tag_name:
description: The name of the tag for which a package should be published
type: string
required: true
env:
GITHUB_BOT_USERNAME: github-actions[bot]
GITHUB_BOT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
PY_COLORS: 1
jobs:
publish:
runs-on: ubuntu-latest
concurrency:
group: publish
steps:
- name: Checking out last commit in release
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- name: Checking out last commit for tag ${{ inputs.tag_name }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag_name }}
lfs: true
fetch-depth: 0
- name: Fail if running locally
if: ${{ env.ACT }} # skip during local actions testing
run: |
echo "Running action locally. Failing"
exit -1
- name: Setup Python 3.8
uses: ./.github/actions/python
with:
python_version: 3.8
- name: Get Current Version
run: |
export CURRENT_VERSION=$(python setup.py --version --quiet | awk -F. '{print $1"."$2"."$3}')
# Make the version available as env variable for next steps
echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV
shell: bash
- name: Deploy Docs
uses: ./.github/actions/deploy-docs
with:
version: ${{ env.CURRENT_VERSION }}
alias: stable
title: ${{ env.CURRENT_VERSION }}
email: ${{ env.GITHUB_BOT_EMAIL }}
username: ${{ env.GITHUB_BOT_USERNAME }}
set-default: 'true'
- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload --verbose --non-interactive dist/*