Skip to content

Release

Release #154

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [Validate]
types:
- completed
branches:
- main
permissions:
id-token: write
contents: write
jobs:
publish-sdk-coverage:
name: Publish SDK test coverage
timeout-minutes: 5
runs-on: ubuntu-latest
environment: main
steps:
- name: Download coverage percentage
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
name: sdk-coverage
- run: awk '{print "COVERAGE_PCT=" $1}' sdk-coverage.txt >> $GITHUB_ENV
- uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_ACCESS_TOKEN }}
gistID: a9b9bfdfa0620696fba9e76223790f53
filename: sdk-coverage.json
label: SDK coverage
message: ${{ env.COVERAGE_PCT }}
minColorRange: 50
maxColorRange: 80
valColorRange: ${{ env.COVERAGE_PCT }}
publish-cli-coverage:
name: Publish CLI test coverage
runs-on: ubuntu-latest
environment: main
steps:
- name: Download coverage percentage
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
name: cli-coverage
- run: awk '{print "COVERAGE_PCT=" $1}' cli-coverage.txt >> $GITHUB_ENV
- uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_ACCESS_TOKEN }}
gistID: a9b9bfdfa0620696fba9e76223790f53
filename: cli-coverage.json
label: CLI coverage
message: ${{ env.COVERAGE_PCT }}
minColorRange: 50
maxColorRange: 80
valColorRange: ${{ env.COVERAGE_PCT }}
release:
name: Release
runs-on: ubuntu-latest
environment: main
timeout-minutes: 15
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
- name: Download build artifact
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
name: dist
path: ./dist
- run: pip install python-semantic-release==9.6.0 twine==5.0.0
- run: |
semantic-release version --commit --tag --push --vcs-release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
- run: twine upload --skip-existing --non-interactive dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}