(patch) Update to SemVer plugin 0.2.2 and update build scripts. #7
3 changed files with 48 additions and 37 deletions
|
@ -2,6 +2,10 @@ on:
|
|||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
library_snapshot:
|
||||
runs-on: docker
|
||||
|
@ -14,28 +18,30 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
name: 'Checkout Repository'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: 'Pre-Commit'
|
||||
run: |
|
||||
pre-commit install
|
||||
pre-commit run --all-files
|
||||
- name: 'Prepare Versioned Build'
|
||||
run: |
|
||||
latest_git_tag="$(git describe --tags --abbrev=0)"
|
||||
latest_commit_message="$(git show -s --format=%s HEAD)"
|
||||
if [[ "$latest_commit_message" == *"(major)"* ]]; then
|
||||
export GS_RELEASE_TYPE="major"
|
||||
elif [[ "$latest_commit_message" == *"(minor)"* ]]; then
|
||||
export GS_RELEASE_TYPE="minor"
|
||||
elif [[ "$latest_commit_message" == *"(patch)"* ]]; then
|
||||
export GS_RELEASE_TYPE="patch"
|
||||
else
|
||||
export GS_RELEASE_TYPE="patch"
|
||||
fi
|
||||
echo "Previous Git Tag: $latest_git_tag"
|
||||
echo "Latest Commit: $latest_commit_message ($GS_RELEASE_TYPE) (SNAPSHOT)"
|
||||
sbtn -Dsnapshot=true -Drelease="$GS_RELEASE_TYPE" semVerInfo
|
||||
- name: 'Unit Tests and Code Coverage'
|
||||
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 ($GS_RELEASE_TYPE)"
|
||||
sbtn clean
|
||||
sbtn coverage
|
||||
sbtn test
|
||||
|
|
|
@ -3,6 +3,10 @@ on:
|
|||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
library_release:
|
||||
runs-on: docker
|
||||
|
@ -15,10 +19,29 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
name: 'Checkout Repository'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: 'Pre-Commit'
|
||||
run: |
|
||||
pre-commit install
|
||||
pre-commit run --all-files
|
||||
- name: 'Prepare Versioned Build'
|
||||
run: |
|
||||
latest_git_tag="$(git describe --tags --abbrev=0)"
|
||||
latest_commit_message="$(git show -s --format=%s HEAD)"
|
||||
if [[ "$latest_commit_message" == *"(major)"* ]]; then
|
||||
export GS_RELEASE_TYPE="major"
|
||||
elif [[ "$latest_commit_message" == *"(minor)"* ]]; then
|
||||
export GS_RELEASE_TYPE="minor"
|
||||
elif [[ "$latest_commit_message" == *"(patch)"* ]]; then
|
||||
export GS_RELEASE_TYPE="patch"
|
||||
else
|
||||
export GS_RELEASE_TYPE="patch"
|
||||
fi
|
||||
echo "Previous Git Tag: $latest_git_tag"
|
||||
echo "Latest Commit: $latest_commit_message"
|
||||
echo "Selected Release Type: '$GS_RELEASE_TYPE'"
|
||||
sbtn -Drelease="$GS_RELEASE_TYPE" semVerInfo
|
||||
- name: 'Unit Tests and Code Coverage'
|
||||
run: |
|
||||
sbtn clean
|
||||
|
@ -27,27 +50,9 @@ 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
|
||||
sbtn "-Drelease=$GS_RELEASE_TYPE" publish
|
||||
sbtn semVerWriteVersionToFile
|
||||
sbtn publish
|
||||
- name: 'Create Git Tag'
|
||||
run: |
|
||||
selected_version="$(cat .version)"
|
||||
|
|
|
@ -30,4 +30,4 @@ externalResolvers := Seq(
|
|||
|
||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
|
||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.2.0")
|
||||
addSbtPlugin("gs" % "sbt-gs-semver" % "0.2.1")
|
||||
addSbtPlugin("gs" % "sbt-gs-semver" % "0.2.2")
|
||||
|
|
Loading…
Add table
Reference in a new issue