Skip to content

Deploy workflow

Deploy workflow #19

Workflow file for this run

name: Deploy workflow
on:
workflow_dispatch:
inputs:
comments:
description: "Comments"
required: false
jobs:
release_changelog:
runs-on: ubuntu-latest
steps:
- name: Print author
run: |
echo "Author: ${{ github.triggering_actor }}"
echo "Comments: ${{ github.event.inputs.comments }}"
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@master
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Draft change log
uses: release-drafter/release-drafter@v5
id: release-drafter
with:
commitish: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set new release version
env:
RD_RELEASE: ${{ steps.release-drafter.outputs.name }}
run: |
if [ ! -z "$RD_RELEASE" ]; then
echo "NEW_RELEASE=$RD_RELEASE" >> $GITHUB_ENV
else
echo "NEW_RELEASE=0.1.0" >> $GITHUB_ENV
fi
- name: Publish change log
uses: release-drafter/release-drafter@v5
with:
commitish: ${{ steps.extract_branch.outputs.branch }}
publish: true
name: ${{ env.NEW_RELEASE }}
tag: "v${{ env.NEW_RELEASE }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs: [release_changelog]
steps:
- uses: actions/checkout@master
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Fetch tags
run: |
git fetch --tags
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Poetry Dynamic Version
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build and publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish --build