Skip to content

Release

Release #128

Workflow file for this run

name: Release
on: create
jobs:
release:
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.TOWNCRIER_TOKEN }}
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Extract the tag
id: vars
run: |
echo "::set-output name=tag::${GITHUB_REF##*/}"
- name: Check tag validity
env:
VERSION: ${{ steps.vars.outputs.tag }}
run: |
grep "^v[[:digit:]]\.[[:digit:]]\.[[:digit:]]$" <<< "$VERSION" || (echo "Invalid version: '$VERSION'" && exit 42)
- name: Install dependencies
run: |
sudo apt install pandoc
python -m pip install --upgrade pip
pip install tox bump2version
pip install -e'.'
- name: Generate release notes
env:
VERSION: ${{ steps.vars.outputs.tag }}
run: |
tox -e build-release-notes -- --version "${VERSION/v/}"
- name: Check generated docs
run: |
tox -e check-docs
- name: Commit release notes
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: docs/source/release/**
commit_user_name: CI
commit_message: ${{ format('[auto][ci skip] Generate {0} release notes', steps.vars.outputs.tag) }}
skip_dirty_check: false
- name: Bump the version
# the part (patch) doesn't matter when supplying --new-version
env:
VERSION: ${{ steps.vars.outputs.tag }}
run: |
bump2version patch --no-commit --no-tag --verbose --new-version "${VERSION/v/}"
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: setup.py squidpy/__init__.py .bumpversion.cfg
commit_user_name: CI
commit_message: ${{ format('[auto][ci skip] Release {0}', steps.vars.outputs.tag) }}
tagging_message: ${{ steps.vars.outputs.tag }}
skip_dirty_check: false
# `Test` triggers `Deployment`
# TODO(michalk8): can't find WD for `Test`
- name: Invoke deployment workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Deployment
token: ${{ secrets.RELEASE_DISPATCH_TOKEN }}
inputs: '{ "reason": "release" }'