From 54424e565a71511736586c9e5064370c34808c0a Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 14 Oct 2025 17:45:01 -0500
Subject: [PATCH 1/5] feat: use git describe --tags for version
---
src/bin/version.js | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/bin/version.js b/src/bin/version.js
index 4d7424b6f..4aa909bb5 100755
--- a/src/bin/version.js
+++ b/src/bin/version.js
@@ -1,22 +1,37 @@
#!/usr/bin/env node
-/** Create CSS version based on lifecycle app data and given data */
+/** Create CSS version based on available data */
const package = require(process.env.npm_package_json || '../package.json');
/**
- * Create version from app data and given data
+ * Create version from available data
* @param {string} [buildId] - Any value to identify the build
*/
function create(buildId) {
const appName = package.name;
- const appVersion = buildId || package.version + '+';
+ const appVersion = buildId || gitDescribeTag() || package.version + '+';
const appLicense = package.license;
const appWebsite = package.homepage.replace('https://', '');
return `${appName} ${appVersion} | ${appLicense} | ${appWebsite}`;
}
+/** Get tag-based description from Git */
+function gitDescribeTag() {
+ const { execSync } = require('child_process');
+ const gitDescribe = undefined;
+
+ try {
+ gitDescribe = execSync('git describe --tags', { encoding: 'utf8' }).trim();
+ console.log('Output from `git describe`:', gitDescribe);
+ } catch (error) {
+ console.error('Error running `git describe`:', error.message);
+ }
+
+ return gitDescribe;
+}
+
/*
Export
*/
From 03bfd0f3da1a5e7876148c08939746112742db2c Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 14 Oct 2025 17:45:22 -0500
Subject: [PATCH 2/5] chore: stop annotating tags
---
bin/release-publish.sh | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/bin/release-publish.sh b/bin/release-publish.sh
index 847379190..1bf0380ea 100755
--- a/bin/release-publish.sh
+++ b/bin/release-publish.sh
@@ -45,19 +45,4 @@ echo "Please create a release on GitHub now."
echo "Visit: https://github.com/TACC/Core-Styles/releases/new"
read -p "Press Enter once you've created the release..."
-# Fetch and check tags
-echo "Fetching tags..."
-git fetch --tags
-
-echo "Checking if tag is annotated..."
-if git describe --exact-match "$version_tag" >/dev/null 2>&1; then
- echo "Tag $version_tag is already annotated"
-else
- echo "Tag $version_tag is not annotated, annotating..."
- ./bin/annotate-tag.sh "$version_tag"
-
- echo "Force pushing annotated tag..."
- git push --tags --force
-fi
-
echo "Release process complete!"
\ No newline at end of file
From bf188df0fc81637fc4d22a825edf056a4bd97b1e Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 14 Oct 2025 17:46:46 -0500
Subject: [PATCH 3/5] fix: use git describe --tags for version
---
src/bin/version.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/bin/version.js b/src/bin/version.js
index 4aa909bb5..207bc945d 100755
--- a/src/bin/version.js
+++ b/src/bin/version.js
@@ -20,7 +20,8 @@ function create(buildId) {
/** Get tag-based description from Git */
function gitDescribeTag() {
const { execSync } = require('child_process');
- const gitDescribe = undefined;
+
+ let gitDescribe = undefined;
try {
gitDescribe = execSync('git describe --tags', { encoding: 'utf8' }).trim();
From d6dff979baaee11b40f4f2f2a4a2f981886a6996 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 14 Oct 2025 18:27:08 -0500
Subject: [PATCH 4/5] docs: prompt user to create release, no wait
---
bin/release-publish.sh | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/bin/release-publish.sh b/bin/release-publish.sh
index 1bf0380ea..310afc611 100755
--- a/bin/release-publish.sh
+++ b/bin/release-publish.sh
@@ -41,8 +41,4 @@ else
fi
# Create GitHub release
-echo "Please create a release on GitHub now."
-echo "Visit: https://github.com/TACC/Core-Styles/releases/new"
-read -p "Press Enter once you've created the release..."
-
-echo "Release process complete!"
\ No newline at end of file
+echo "Create GitHub release now: https://github.com/TACC/Core-Styles/releases/new"
From 8449fe1075a2bbbcc064c3fe4e0d1c7d076b9006 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 14 Oct 2025 18:52:43 -0500
Subject: [PATCH 5/5] docs: use git describe --tags for version
---
PUBLISHING.md | 11 -----------
bin/annotate-tag.sh | 37 -------------------------------------
2 files changed, 48 deletions(-)
delete mode 100755 bin/annotate-tag.sh
diff --git a/PUBLISHING.md b/PUBLISHING.md
index 32bdc307a..ae322ae40 100644
--- a/PUBLISHING.md
+++ b/PUBLISHING.md
@@ -34,16 +34,5 @@ Only appointed team members may publish releases.
`npm publish --access public`\
Project build will automatically occur before publish.
1. Create release and tag on GitHub.
-1. Fetch the latest tags.\
- `git fetch --tags`
-1. Check whether tag is annotated.\
- `git describe --always`\
- (expect `vN.N.N` i.e. the version tag)
-1. **If** tag is **not** annotated, **then**:
- 1. Annotate Github's tag:\
- `bin/annotate-tag.sh vN.N.N`\
- (where `N.N.N` is the version tag)
- 1. Overwrite remote tag with annotated one:\
- `git push --tags --force`
diff --git a/bin/annotate-tag.sh b/bin/annotate-tag.sh
deleted file mode 100755
index 2f5dcb027..000000000
--- a/bin/annotate-tag.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-# Annotate a tag from Github
-# FAQ: Github releases create annotated (not lightweight) tags
-# SEE: https://github.com/orgs/community/discussions/4924
-
-# Whether string is a valid SemVer version
-is_valid_semver() {
- local version=$1
- # SemVer regex pattern (simplified for illustration)
- local semver_pattern="^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$"
- [[ $version =~ $semver_pattern ]]
-}
-
-# Is argument (string) provided?
-if [ $# -ne 1 ]; then
- echo "Usage: $0 "
- exit 1
-fi
-
-# Capture arguments
-version_string=$1
-
-# Is string a valid SemVer version?
-if ! is_valid_semver "$version_string"; then
- echo "Error: Invalid SemVer format. Please provide a valid version string like '3.11.6' or 'v3.12.0-beta.3' or 'v3.6.0-8-gd1dbcab'."
- exit 1
-fi
-
-# Annotate the tag
-git fetch --tags
-git checkout "$version_string"
-git tag -d "$version_string"
-git tag -a "$version_string" -m "chore: $version_string"
-
-# Report success
-echo "Annotated tag \"$version_string\"."