Skip to content

Release

Release #64

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
type: choice
required: true
description: "Version bump type"
options:
- patch
- minor
- major
permissions:
id-token: write
checks: write
contents: write
pull-requests: read
jobs:
# Run security checks first via reusable workflow
security-checks:
uses: SolaceDev/solace-public-workflows/.github/workflows/hatch_release_security_checks.yml@main
with:
sonarqube_hotspot_check: true
fossa_check: true
whitesource_project_name: ${{ github.event.repository.name }}
whitesource_product_name: "solaceai"
secrets:
SONARQUBE_PROJECT_KEY: ${{ github.event.repository.owner }}_${{ github.event.repository.name }}
SONARQUBE_PROJECT_MAIN_BRANCH: "main"
SONARQUBE_QUERY_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
SONARQUBE_HOTSPOTS_API_URL: ${{ secrets.SONARQUBE_HOTSPOTS_API_URL }}
WHITESOURCE_API_KEY: ${{ secrets.WHITESOURCE_API_KEY }}
MANIFEST_AWS_ACCESS_KEY_ID: ${{ secrets.MANIFEST_READ_ONLY_AWS_ACCESS_KEY_ID }}
MANIFEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.MANIFEST_READ_ONLY_AWS_SECRET_ACCESS_KEY }}
MANIFEST_AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
# Release to PyPI using Trusted Publishing
release:
name: Release to PyPI
needs: security-checks
runs-on: ubuntu-latest
timeout-minutes: 20
environment: pypi
outputs:
new_version: ${{ steps.prep.outputs.new_version }}
commit_hash: ${{ steps.prep.outputs.commit_hash }}
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
fetch-depth: 0
ssh-key: ${{ secrets.COMMIT_KEY }}
- name: Prepare Release
id: prep
uses: SolaceDev/solace-public-workflows/.github/actions/hatch-release-prep@main
with:
version: ${{ github.event.inputs.version }}
# Publish using Trusted Publishing - must be directly in workflow, not in composite action
# See: https://docs.pypi.org/trusted-publishers/using-a-publisher/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
with:
verbose: true
- name: Finalize Release
uses: SolaceDev/solace-public-workflows/.github/actions/hatch-release-post@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
new_version: ${{ steps.prep.outputs.new_version }}
current_version: ${{ steps.prep.outputs.current_version }}
skip_bump: ${{ steps.prep.outputs.skip_bump }}