From 111105fc55afb8c9d01f48d0bfed001e8861fb0d Mon Sep 17 00:00:00 2001 From: Pat Garrity Date: Sun, 14 Apr 2024 21:04:43 -0500 Subject: [PATCH] (patch) Scala Version, Docs, Builds --- .forgejo/workflows/pull_request.yaml | 22 ++++++++++--- .forgejo/workflows/release.yaml | 47 +++++++++++++++++++++------- README.md | 11 ++++++- build.sbt | 2 +- project/plugins.sbt | 4 +-- 5 files changed, 66 insertions(+), 20 deletions(-) diff --git a/.forgejo/workflows/pull_request.yaml b/.forgejo/workflows/pull_request.yaml index 8ca9d2b..bba274a 100644 --- a/.forgejo/workflows/pull_request.yaml +++ b/.forgejo/workflows/pull_request.yaml @@ -34,12 +34,21 @@ jobs: export GS_RELEASE_TYPE="minor" elif [[ "$latest_commit_message" == *"(patch)"* ]]; then export GS_RELEASE_TYPE="patch" + elif [[ "$latest_commit_message" == *"(docs)"* ]]; then + export GS_RELEASE_TYPE="norelease" + elif [[ "$latest_commit_message" == *"(norelease)"* ]]; then + export GS_RELEASE_TYPE="norelease" else - export GS_RELEASE_TYPE="patch" + export GS_RELEASE_TYPE="norelease" fi + echo "GS_RELEASE_TYPE=$GS_RELEASE_TYPE" >> $GITHUB_ENV 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 + if [ "$GS_RELEASE_TYPE" = "norelease" ]; then + sbtn -Dsnapshot=true -Drelease="patch" semVerInfo + else + sbtn -Dsnapshot=true -Drelease="$GS_RELEASE_TYPE" semVerInfo + fi - name: 'Unit Tests and Code Coverage' run: | sbtn clean @@ -48,5 +57,10 @@ jobs: sbtn coverageReport - name: 'Publish Snapshot' run: | - sbtn clean - sbtn publish + echo "Testing env var propagation = ${{ env.GS_RELEASE_TYPE }}" + if [ "${{ env.GS_RELEASE_TYPE }}" = "norelease" ]; then + echo "Skipping publish due to GS_RELEASE_TYPE=norelease" + else + sbtn clean + sbtn publish + fi diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index ecbd203..8351605 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -35,26 +35,49 @@ jobs: export GS_RELEASE_TYPE="minor" elif [[ "$latest_commit_message" == *"(patch)"* ]]; then export GS_RELEASE_TYPE="patch" + elif [[ "$latest_commit_message" == *"(docs)"* ]]; then + export GS_RELEASE_TYPE="norelease" + elif [[ "$latest_commit_message" == *"(norelease)"* ]]; then + export GS_RELEASE_TYPE="norelease" else - export GS_RELEASE_TYPE="patch" + export GS_RELEASE_TYPE="norelease" fi + + echo "GS_RELEASE_TYPE=$GS_RELEASE_TYPE" >> $GITHUB_ENV 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 + + if [ "$GS_RELEASE_TYPE" = "norelease" ]; then + echo "Skipping all versioning for 'norelease' commit." + else + sbtn -Drelease="$GS_RELEASE_TYPE" semVerInfo + fi - name: 'Unit Tests and Code Coverage' run: | - sbtn clean - sbtn coverage - sbtn test - sbtn coverageReport + if [ "${{ env.GS_RELEASE_TYPE }}" = "norelease" ]; then + echo "Skipping build/test for 'norelease' commit." + else + sbtn clean + sbtn coverage + sbtn test + sbtn coverageReport + fi - name: 'Publish Release' run: | - sbtn clean - sbtn semVerWriteVersionToFile - sbtn publish + if [ "${{ env.GS_RELEASE_TYPE }}" = "norelease" ]; then + echo "Skipping publish for 'norelease' commit." + else + sbtn clean + sbtn semVerWriteVersionToFile + sbtn publish + fi - name: 'Create Git Tag' run: | - selected_version="$(cat .version)" - git tag "$selected_version" - git push origin "$selected_version" + if [ "${{ env.GS_RELEASE_TYPE }}" = "norelease" ]; then + echo "Skipping Git tag for 'norelease' commit." + else + selected_version="$(cat .version)" + git tag "$selected_version" + git push origin "$selected_version" + fi diff --git a/README.md b/README.md index 9dfa7b8..a468a13 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # gs-slug -[License (Apache 2.0)](./LICENSE) +[GS Open Source](https://garrity.co/oss.html) | +[License (MIT)](./LICENSE) Scala 3 Slugs. Slugs are URL-safe restricted string identifiers. - [Usage](#usage) + - [Dependency](#dependency) + - [Slug Type](#slug-type) +- [Donate](#donate) ## Usage @@ -37,3 +41,8 @@ Additionally, `Slug` is usually intended to be unique within some _context_, where the implementation defines the context. For example, if some organization owns a number of repositories, each repository might have a `Slug` which is unique within that organization. + +## Donate + +Enjoy this project or want to help me achieve my [goals](https://garrity.co)? +Consider [Donating to Pat on Ko-fi](https://ko-fi.com/gspfm). diff --git a/build.sbt b/build.sbt index 17b50dd..df08623 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -val scala3: String = "3.4.0" +val scala3: String = "3.4.1" ThisBuild / scalaVersion := scala3 ThisBuild / versionScheme := Some("semver-spec") diff --git a/project/plugins.sbt b/project/plugins.sbt index 78b59cb..e897854 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -29,5 +29,5 @@ 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.2") +addSbtPlugin("gs" % "sbt-garrity-software" % "0.3.0") +addSbtPlugin("gs" % "sbt-gs-semver" % "0.3.0") -- 2.43.0