Skip to content

Release 0.10.0

Release 0.10.0 #38

Workflow file for this run

name: Release workflow
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: 'Version number to release in X.Y.Z format'
dry_run:
type: boolean
default: true
description: 'Dry run'
pull_request:
types:
- closed
branches:
- 'fake_main'
jobs:
release_workflow:
runs-on: ubuntu-latest
steps:
- name: Gitflow action
id: gitflow-action
uses: hoangvvo/gitflow-workflow-action@0.3.7
with:
develop_branch: "fake_develop"
main_branch: "fake_main"
version: ${{ inputs.version }}
version_increment: ${{ contains(github.head_ref, 'hotfix/') && 'patch' || '' }}
dry_run: ${{ inputs.dry_run }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ steps.gitflow-action.outputs.release_branch || 'fake_main' }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 'latest'
- name: Bump version
if: ${{ steps.gitflow-action.outputs.release_branch }}
env:
VERSION: ${{ steps.gitflow-action.outputs.version }}
run: poetry version $VERSION
- name: Build and publish package
if: ${{ !steps.gitflow-action.outputs.release_branch }}
env:
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi $TEST_PYPI_TOKEN
poetry publish --build --dry-run