(patch) Update to SemVer plugin 0.2.2 and update build scripts. (#7)
All checks were successful
/ Build and Release Library (push) Successful in 1m17s
All checks were successful
/ Build and Release Library (push) Successful in 1m17s
This commit is contained in:
parent
b70da830f7
commit
20fb91a62b
3 changed files with 48 additions and 37 deletions
|
@ -2,6 +2,10 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
library_snapshot:
|
library_snapshot:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
@ -14,28 +18,30 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
name: 'Checkout Repository'
|
name: 'Checkout Repository'
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: 'Pre-Commit'
|
- name: 'Pre-Commit'
|
||||||
run: |
|
run: |
|
||||||
pre-commit install
|
pre-commit install
|
||||||
pre-commit run --all-files
|
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'
|
- name: 'Unit Tests and Code Coverage'
|
||||||
run: |
|
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 clean
|
||||||
sbtn coverage
|
sbtn coverage
|
||||||
sbtn test
|
sbtn test
|
||||||
|
|
|
@ -3,6 +3,10 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
library_release:
|
library_release:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
@ -15,10 +19,29 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
name: 'Checkout Repository'
|
name: 'Checkout Repository'
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: 'Pre-Commit'
|
- name: 'Pre-Commit'
|
||||||
run: |
|
run: |
|
||||||
pre-commit install
|
pre-commit install
|
||||||
pre-commit run --all-files
|
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'
|
- name: 'Unit Tests and Code Coverage'
|
||||||
run: |
|
run: |
|
||||||
sbtn clean
|
sbtn clean
|
||||||
|
@ -27,27 +50,9 @@ jobs:
|
||||||
sbtn coverageReport
|
sbtn coverageReport
|
||||||
- name: 'Publish Release'
|
- name: 'Publish Release'
|
||||||
run: |
|
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 clean
|
||||||
sbtn "-Drelease=$GS_RELEASE_TYPE" semVerInfo
|
sbtn semVerWriteVersionToFile
|
||||||
sbtn "-Drelease=$GS_RELEASE_TYPE" semVerWriteVersionToFile
|
sbtn publish
|
||||||
sbtn "-Drelease=$GS_RELEASE_TYPE" publish
|
|
||||||
- name: 'Create Git Tag'
|
- name: 'Create Git Tag'
|
||||||
run: |
|
run: |
|
||||||
selected_version="$(cat .version)"
|
selected_version="$(cat .version)"
|
||||||
|
|
|
@ -30,4 +30,4 @@ externalResolvers := Seq(
|
||||||
|
|
||||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
|
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
|
||||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.2.0")
|
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