(patch) Automating release builds. (#4)
Some checks failed
/ Build and Release Library (push) Failing after 2m19s
Some checks failed
/ Build and Release Library (push) Failing after 2m19s
This commit is contained in:
parent
1c7861705d
commit
be74eab804
1 changed files with 20 additions and 12 deletions
|
@ -1,15 +1,7 @@
|
|||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseType:
|
||||
description: 'Release Type'
|
||||
required: true
|
||||
default: 'patch'
|
||||
type: choice
|
||||
options:
|
||||
- major
|
||||
- minor
|
||||
- patch
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
library_release:
|
||||
|
@ -20,7 +12,6 @@ jobs:
|
|||
env:
|
||||
GS_MAVEN_USER: ${{ vars.GS_MAVEN_USER }}
|
||||
GS_MAVEN_TOKEN: ${{ secrets.GS_MAVEN_TOKEN }}
|
||||
GS_RELEASE_TYPE: ${{ inputs.releaseType }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
name: 'Checkout Repository'
|
||||
|
@ -36,6 +27,23 @@ jobs:
|
|||
sbtn coverageReport
|
||||
- name: 'Publish Release'
|
||||
run: |
|
||||
latest_commit_message="$(git show -s --format=%s HEAD)"
|
||||
case "$latest_commit_message" in
|
||||
*(patch)*)
|
||||
export GS_RELEASE_TYPE="patch"
|
||||
;;
|
||||
*(minor)*)
|
||||
export GS_RELEASE_TYPE="minor"
|
||||
;;
|
||||
*(major)*)
|
||||
export GS_RELEASE_TYPE="major"
|
||||
;;
|
||||
*)
|
||||
export GS_RELEASE_TYPE="patch"
|
||||
;;
|
||||
esac
|
||||
echo "Latest Commit: $latest_commit_message"
|
||||
echo "Selected Release Type: '$GS_RELEASE_TYPE'"
|
||||
sbtn clean
|
||||
sbtn "-Drelease=$GS_RELEASE_TYPE" semVerInfo
|
||||
sbtn "-Drelease=$GS_RELEASE_TYPE" semVerWriteVersionToFile
|
||||
|
|
Loading…
Add table
Reference in a new issue