Skip to content

Releasing maven-unique-feature-branch-action #2 #2

Releasing maven-unique-feature-branch-action #2

Releasing maven-unique-feature-branch-action #2 #2

name: Release Workflow
run-name: "Releasing ${{ github.event.repository.name }} #${{github.run_number}}"
# Trigger workflow manually
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release Type'
required: true
type: choice
options:
- -- SELECT --
- Major
- Minor
- Patch
default: -- SELECT --
env:
BRANCH_NAME: ${{github.ref_name}}
TRUNK_BRANCH_NAME: ${{github.event.repository.default_branch}}
jobs:
release:
name: Release
runs-on: ubuntu-24.04
if: github.repository_owner == 'ikmdev'
steps:
- name: Verify Input
if: inputs.release_type == '-- SELECT --'
run: |
echo "ERROR: Please enter release type"
exit 1
- 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: Checkout Code
uses: actions/checkout@v4.2.2
with:
token: ${{secrets.IKMDEVOPS_PAT_TOKEN}}
fetch-depth: 0
- name: Get Latest Release Tag
id: latestTag
run: |
git fetch --tags
echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
echo "TAG: " $LATEST_TAG