Skip to content

Releasing demo-java-maven #7 #7

Releasing demo-java-maven #7

Releasing demo-java-maven #7 #7

name: SemVer Release Workflow
run-name: "Releasing ${{ github.event.repository.name }} #${{ github.run_number }}"
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version type to increment'
required: true
default: 'select'
type: choice
options:
- select
- major
- minor
- patch
set_version:
description: 'Set version number explicitly (e.g., 1.2.3). Leave empty to increment.'
required: false
env:
BRANCH_NAME: ${{ github.ref_name }}
TRUNK_BRANCH_NAME: 'main'
jobs:
release:
name: Release
runs-on: ubuntu-24.04
if: github.repository_owner == 'ikmdev'
steps:
- name: Verify Branch
if: env.BRANCH_NAME != env.TRUNK_BRANCH_NAME
run: |
echo "ERROR: Attempting to release from branch ${{ env.BRANCH_NAME }}. Release from ${{ env.TRUNK_BRANCH_NAME }} branch only."
exit 1
- name: Shared Release Action
uses: ikmdev/maven-semver-release-action@main
with:
version_type: ${{ github.event.inputs.version_type }}
set_version: ${{ github.event.inputs.set_version }}
ikmdevops_pat: ${{secrets.IKMDEVOPS_PAT_TOKEN}}
github_token: ${{secrets.GITHUB_TOKEN}}
ossrh_username: ${{secrets.OSSRH_TOKEN_USER}}
ossrh_token: ${{secrets.OSSRH_TOKEN_PASS}}
gpg_key: ${{secrets.GPG_KEY}}
gpg_passphrase: ${{secrets.GPG_PASSPHRASE}}
trunk_branch_name: ${{ env.TRUNK_BRANCH_NAME }}