Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,5 @@ Only appointed team members may publish releases.
`npm publish --access public`\
<sub>Project build will automatically occur before publish.</sub>
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`

</details>
37 changes: 0 additions & 37 deletions bin/annotate-tag.sh

This file was deleted.

21 changes: 1 addition & 20 deletions bin/release-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +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..."

# 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!"
echo "Create GitHub release now: https://github.com/TACC/Core-Styles/releases/new"
22 changes: 19 additions & 3 deletions src/bin/version.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
#!/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');

let 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
*/
Expand Down