Skip to content

Continuous Delivery (Release) #60

Continuous Delivery (Release)

Continuous Delivery (Release) #60

Workflow file for this run

name: Continuous Delivery (Release)
on:
workflow_dispatch:
inputs:
project:
description: 'Project to release'
required: true
default: 'pytest-backend'
type: choice
options:
- "pytest-extension"
- "pytest-slc"
- "pytest-backend"
- "pytest-saas"
- "pytest-itde"
version:
description: 'Version number for the release'
required: true
type: string
jobs:
Release:
name: Release ${{ inputs.project }}
runs-on: ubuntu-24.04
permissions:
contents: write
defaults:
run:
working-directory: ${{ inputs.project }}
steps:
- name: Fail if not running on main branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/github-script@v7
with:
script: |
core.setFailed('Not running on main branch, github.ref is ${{ github.ref }}. Please start this workflow only on main')
- name: SCM Checkout
uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
working-directory: ${{ inputs.project }}
poetry-version: '2.1.2'
- name: Build Artifacts
run: poetry build
- name: PyPi Release
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
run: poetry publish
- name: GitHub Release
env:
TAG: "${{ inputs.project }}-${{ inputs.version }}"
PROJECT: "${{ inputs.project }}"
VERSION: "${{ inputs.version }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
run: >
gh release create ${TAG}
--title ${TAG}
--notes-file ./doc/changes/changes_${VERSION}.md
--latest
--target main
dist/*