Continuous Delivery (Release) #45
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: Continuous Delivery (Release) | |
on: | |
workflow_dispatch: | |
inputs: | |
project: | |
description: 'Project to release' | |
required: true | |
default: 'pytest-saas' | |
type: choice | |
options: | |
- "pytest-extension" | |
- "pytest-slc" | |
- "pytest-backend" | |
- "pytest-saas" | |
- "pytest-itde" | |
version: | |
description: 'Version number for the release' | |
required: true | |
type: int | |
jobs: | |
Release: | |
runs-on: ubuntu-20.04 | |
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 Development Environment | |
uses: ./.github/actions/pytest-plugins-environment | |
- name: | |
run: | | |
just release ${PROJECT} | |
gh release create ${TAG} \ | |
--title ${TAG} \ | |
--notes-file ./${PROJECT}/doc/changes/changes_${VERSION}.md \ | |
--latest \ | |
--target main \ | |
${PROJECT}/dist/* | |
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 }}" |