Skip to content

Release (Manual)

Release (Manual) #4

Workflow file for this run

name: Release (Manual)
on:
# Enable execution directly from Actions page
workflow_dispatch:
inputs:
bump-version:
description: 'Bump Level?'
type: choice
options:
- 'major'
- 'minor'
- 'patch'
- 'prerelease'
required: true
as-prerelease:
description: 'As pre-release?'
type: boolean
required: true
default: false
# default token permissions = none
permissions: {}
jobs:
build:
name: Verify Docker Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.ref_name }}
- name: Build Docker Image
run: |
docker build -t psr-upload-to-release:latest .
release:
name: Semantic Release
runs-on: ubuntu-latest
concurrency: push
needs: [build]
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
root_options: "-vv -c releaserc.toml"
force: ${{ github.event.inputs.bump-version }}
prerelease: ${{ github.event.inputs.as-prerelease }}
changelog: false
- name: Update Minor Release Tag Reference
if: steps.release.outputs.released == 'true'
env:
FULL_VERSION_TAG: ${{ steps.release.outputs.tag }}
run: |
MINOR_VERSION_TAG=$(echo $FULL_VERSION_TAG | cut -d. -f1,2)
git tag --force --annotate "$MINOR_VERSION_TAG" "${VERSION}^{}" -m "$MINOR_VERSION_TAG"
git push -u origin "$MINOR_VERSION_TAG" --force
- name: Update Major Release Tag Reference
if: steps.release.outputs.released == 'true'
env:
FULL_VERSION_TAG: ${{ steps.release.outputs.tag }}
run: |
MAJOR_VERSION_TAG=$(echo $FULL_VERSION_TAG | cut -d. -f1)
git tag --force --annotate "$MAJOR_VERSION_TAG" "${VERSION}^{}" -m "$MAJOR_VERSION_TAG"
git push -u origin "$MAJOR_VERSION_TAG" --force