Release #1
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
rule: | |
description: "Rule to run" | |
required: false | |
default: patch | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
- premajor | |
- preminor | |
- prepatch | |
- prerelease | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
- name: Get changelog | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
dry_run: true | |
- name: Update version | |
run: | | |
poetry version ${{ github.event.inputs.rule }} | |
version=$(poetry version -s) | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -am "[skip ci] Update version to ${{ env.VERSION }}" | |
git push | |
- name: Create and push tag | |
run: | | |
git tag v${{ env.VERSION }} | |
git push origin v${{ env.VERSION }} | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: v${{ env.VERSION }} | |
release_name: Release v${{ env.VERSION }} | |
draft: false | |
prerelease: false | |
body: ${{ steps.tag_version.outputs.changelog }} | |
- name: Publish package | |
env: | |
PYPI_LOCAL_USERNAME: __token__ | |
PYPI_LOCAL_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
poetry build | |
poetry publish -u $PYPI_LOCAL_USERNAME -p $PYPI_LOCAL_PASSWORD | |
- name: Generate docs | |
run: | | |
cp ./readme.md ./docs_src/readme.md | |
poetry run sphinx-apidoc -f -o ./docs_src ./ddb_single | |
poetry run sphinx-build ./docs_src ./docs | |
- name: Publish github pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: ./docs | |
clean: true | |
commit-message: Deploy as of ${{ github.sha }} |