This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): added semantic versioning for release and prelease
- Loading branch information
Aerex
committed
Mar 26, 2018
1 parent
261b081
commit 7ffdd26
Showing
8 changed files
with
106 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[commit] | ||
template = .gittemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Type(<scope>): <subject> | ||
# <body> | ||
# <footer> | ||
|
||
# Type should be one of the following: | ||
# * BREAKING CHANGES (breaking change) [major release -- 1.x.x] | ||
# * feat (new feature) [minor release -- x.1.x] | ||
# * fix (bug fix) [patch release -- 0.0.x] | ||
# * docs (changes to documentation) | ||
# * style (formatting, missing semi colons, etc; no code change) | ||
# * refactor (refactoring production code) | ||
# * test (adding missing tests, refactoring tests; no production code change) | ||
# * chore (updating grunt tasks etc; no production code change) | ||
# Scope is just the scope of the change. Something like (admin) or (teacher). | ||
# Subject should use clear words and say what you did. | ||
# The body should go into detail about changes made. | ||
# The footer should contain any Github (or other tool) issue references or actions. | ||
|
||
# For a full example of how to write a good commit message, check out | ||
# https://conventionalcommits.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- '8' | ||
|
||
script: npm test && npm run coveralls && ./npm_patch.sh | ||
|
||
before_install: | ||
- npm i -g makeshift && makeshift -r https://registry.npmjs.org | ||
- npm i -g markdown-to-html | ||
- wget https://github.com/github/hub/releases/download/v2.2.9/hub-linux-386-2.2.9.tgz | ||
- tar -xvzf hub-linux-386-2.2.9.tgz | ||
- export PATH=${PATH}:$PWD/hub-linux-386-2.2.9/bin/ | ||
before_script: | ||
- cd /tmp | ||
- git clone -b master https://github.com/ibm-developer/changelog-generator-slack-notification.git | ||
- npm install changelog-generator-slack-notification | ||
- cd - | ||
script: npm test && npm run coveralls && ./npm_version_upgrade.sh | ||
branches: | ||
only: | ||
- development | ||
- master | ||
|
||
- development | ||
- master | ||
notifications: | ||
slack: | ||
rooms: | ||
- $SLACK_ARF_DEVOPS | ||
|
||
deploy: | ||
provider: npm | ||
email: $NPM_EMAIL | ||
api_key: $NPM_TOKEN | ||
on: | ||
branch: master | ||
slack: | ||
secure: y00hcpzZCTngonvGE8QvJH0ObjMpvGvNDEZS4ViVP6p2CDcNkRtrKjKxHVepxuTnHPLRxQu04+06MN1ORfhy1pLdSXgPNkVF9HGLXGdjDw9eu7njPykLkMIijo//sZI0oOR/cr1CbQN8MuEJ4Yru6B/FA10r9/gXqi7avDuRfjUeeJkwFlpndvKs52waIRGkRLzDo4LuJ55u85ufZoXkbPKyVs/0hZgaazWJHQP8K54gCCbigq0c9sFVU22vmFKOrTRoSh4PYEjy2dyRB2ToPeD+K695S0p/J7rYyiWgdEz1ihVmiUTvvUPR0Qz1Qj63Khj5cAO0UIV2v+tuTGUWyuJRuHWjlOlefXDfCPky4QsdNfyvA8NQ2YGfonL7mVFjKMJlL2Kz8eB6cylb9zEGfqqT3wz6+hDI2sWv5ZX3cS9bSbY7enxkPT+0Be5BWRU36bkvHz89Ejlw6yet8OKRSOfdqNip0OgJ19Hw76YQTIQCvNLVUHEOyojpYT6wkN8NZGh0Ddw3/DNyTfqJRctP8NwT1x57L7UzBzgJskBNb/yQjvdMkAf/b1r48BKjPUEC9g9rORj6hFMTw297KvmlGDu4c+wyNmWlTxmHcDXQV3+8K4/V5VQqblrnhm8CP7+rKcFlElCZs4f47mFv3T0o6Oo41l+76KYi3WuYYcw1tcg= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
CMD=$(cat .git/config | grep "commit") | ||
if [ -z $CMD ]; then | ||
echo "$(cat .git/config)\n$(cat .gitconfig)" > ./.git/config | ||
else | ||
echo "commit file template already saved" | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ev | ||
|
||
echo "Auto version updating script : version 0.0.1" | ||
echo "Checking if a new version update is required ..." | ||
PKG_NAME=`node -e "console.log(require('./package.json').name);"` | ||
export PKG_VER=`node -e "console.log(require('./package.json').version);"` | ||
export NPM_VER=`npm show $PKG_NAME version` | ||
echo "$PKG_NAME : version = $PKG_VER, npm version = $NPM_VER" | ||
HTML=$(markdown CHANGELOG.md) | ||
|
||
if [ $TRAVIS_BRANCH = "master" ]; then | ||
echo "Build targetting master - checking if this is a PR or not" | ||
if [[ "${TRAVIS_PULL_REQUEST}" = "false" ]]; then | ||
echo "This is a build on master, performing additional steps" | ||
if [ $NPM_VER == $PKG_VER ]; then | ||
echo "Version numbers match, so changing version and committing changes" | ||
./prerelease.sh | ||
retval=$? | ||
if [[ $retval != 0 ]]; then | ||
exit $retval | ||
fi | ||
else | ||
npm publish | ||
node /tmp/changelog-generator-slack-notification/index.js --html "$HTML" --name "$PKG_NAME" --api "$SLACK_WEBHOOK" --v "$PKG_VER" | ||
fi | ||
|
||
|
||
fi | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
echo "Running pre-release checks and scans" | ||
CURRENT_PKG_VER=`node -e "console.log(require('./package.json').version);"` | ||
echo "Determining current version: ${CURRENT_PKG_VER}" | ||
LINE="bumping version in package.json from ${CURRENT_PKG_VER} to" | ||
PKG_VER_NEXT=$(standard-version --dry-run | grep 'package.json from' | awk -v FS="${LINE}" -v OFS="" '{$1 = ""; print}') | ||
PKG_VER_NEXT="$(echo -e "${PKG_VER_NEXT}" | tr -d '[:space:]')" | ||
|
||
echo "Determining next version: ${PKG_VER_NEXT}" | ||
|
||
USER_EMAIL=$(git --no-pager show -s --format='%ae' "${TRAVIS_COMMIT}") | ||
USER_NAME=$(git --no-pager show -s --format='%an' "${TRAVIS_COMMIT}") | ||
git config user.email "${USER_EMAIL}" | ||
git config user.name "${USER_NAME}" | ||
|
||
echo "Creating git branch" | ||
BRANCH="updateTo${PKG_VER_NEXT}" | ||
git checkout -b $BRANCH | ||
|
||
npm run version | ||
git remote rm origin | ||
git remote add origin $GITHUB_URL_SECURED | ||
git push --follow-tags --set-upstream origin $BRANCH | ||
hub pull-request -b master -m "chore: Merging CHANGELOG and package.json changes" |