diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 1877ea0d..77caec35 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -9,7 +9,7 @@ on: - 'v*' jobs: - test-code: + test_code: runs-on: ubuntu-latest steps: - name: "Install dependencies" @@ -33,10 +33,10 @@ jobs: env: TEST_NAME: "Unit Tests" run: |- + TESTS_OK=1 set +e set -o pipefail go test ./... 2>&1 | tee test-results.txt - set -e S=$? #non-0 means error if [ $S -eq 0 ]; then R="Test(s) Passed: ${TEST_NAME}" @@ -46,9 +46,20 @@ jobs: R="Test(s) '${TEST_NAME}' failed" echo "::error::$R" R=":x: $R" + TESTS_OK=0 fi + set -e echo "### ${R}" >> $GITHUB_STEP_SUMMARY echo '---' >> $GITHUB_STEP_SUMMARY echo '```shell' >> $GITHUB_STEP_SUMMARY cat test-results.txt >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY + + if [[ "${TESTS_OK}" == "0" ]]; then + exit 1 + fi + + tag-branch: + needs: [test_code] + uses: ./.github/workflows/util-tag-branch.yml + secrets: inherit diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 53ce8dfb..9cbcef92 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -19,7 +19,8 @@ jobs: # limit to only first 3 chars VER_BUILD=${VER_BUILD:0:3} # 'strict' semver segments cannot start with 0 - VERSION_NUM="$(date +%y).$(date +%-m).$(date +%-d).${VER_BUILD#0}" + VERSION_NUM="0.$(date +%y)$(date +%m).$(date +%-d).${VER_BUILD#0}" + echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT # recreate as INT, leaving 0's in place; creates a 'reasonable' 32-bit signed int. VERSION_INT="$(date +%y)$(date +%m)$(date +%d)${VER_BUILD}" echo "VERSION_INT=${VERSION_INT}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/util-tag-branch.yml b/.github/workflows/util-tag-branch.yml index ea02b839..0db9882b 100644 --- a/.github/workflows/util-tag-branch.yml +++ b/.github/workflows/util-tag-branch.yml @@ -1,6 +1,6 @@ name: "Create version tag" -on: [workflow_dispatch] +on: [workflow_call] jobs: tag-branch: @@ -8,8 +8,6 @@ jobs: environment: default steps: - uses: actions/checkout@v4 - with: - ref: ${{ env.GITHUB_REF }} - name: "Create Version Tag" id: version_cfg @@ -20,7 +18,7 @@ jobs: # limit to only first 3 chars VER_BUILD=${VER_BUILD:0:3} # 'strict' semver segments cannot start with 0 - VERSION_NUM="$(date +%y).$(date +%-m).$(date +%-d).${VER_BUILD#0}" + VERSION_NUM="0.$(date +%y)$(date +%m).$(date +%-d).${VER_BUILD#0}" echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT # recreate as INT, leaving 0's in place; creates a 'reasonable' 32-bit signed int. VERSION_INT="$(date +%y)$(date +%m)$(date +%d)${VER_BUILD}" diff --git a/utils/text.go b/utils/text.go index 07a69871..e3ed8437 100644 --- a/utils/text.go +++ b/utils/text.go @@ -18,7 +18,7 @@ var wordTokenRegex = wordTokenRegexPattern() func wordTokenRegexPattern() *regexp.Regexp { thePattern, ok := os.LookupEnv("WordTokenRegex") if !ok || thePattern == "" { - thePattern = `[\pM\pL\pN_'-]+|\pS` + thePattern = `[\pM\pL\pN_']+|\pS` } return regexp.MustCompile(thePattern) }