Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Add automatic CI versioning (#40)
Browse files Browse the repository at this point in the history
Updates travis.yml to use frauci-update-version to bump package.json version and tag commit on each commit/pr merge to master. Use travis releases provider to create a new github release matching tag.
  • Loading branch information
mdgbayly authored Apr 2, 2019
1 parent 528be16 commit 53f0ca2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
46 changes: 30 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
language: node_js
language: node_js
node_js: node
addons:
chrome: stable
script:
- npm run test:lint
- |
if [ $TRAVIS_PULL_REQUEST != false ] && [ $TRAVIS_SECURE_ENV_VARS == true ]; then
echo "Pull request with secure environment variables, running Sauce tests...";
npm run test:polymer:sauce || travis_terminate 1;
else
echo "Not a pull request and/or no secure environment variables, running headless tests...";
npm run test:polymer:local || travis_terminate 1;
fi
env:
global:
- SAUCE_USERNAME: Desire2Learn
- secure: RtWC2uMUHvox7Y/qdWd7wrxEYedg1MdnZp9aoI2jL8KP4gi/efeFhzBIjIShnv6hnkJdf7Vy+5PTwgp4q6i4HZzmIAjyEGX+J5xd8emd3yrYg2puBrKI4bE+qzjnrWsc/9tbeqbRviFZzJzLzGCz9t1H3m/USKnzU71z7M3lFlA=
chrome: stable
script:
- npm run test:lint
- |
if [ $TRAVIS_PULL_REQUEST != false ] && [ $TRAVIS_SECURE_ENV_VARS == true ]; then
echo "Pull request with secure environment variables, running Sauce tests...";
npm run test:polymer:sauce || travis_terminate 1;
else
echo "Not a pull request and/or no secure environment variables, running headless tests...";
npm run test:polymer:local || travis_terminate 1;
fi
- |
if [ "$TRAVIS_BRANCH" == "master" ] && [ $TRAVIS_PULL_REQUEST == false ]; then
echo "Not a Pull Request and on branch master so bumping version";
frauci-update-version;
export TRAVIS_TAG=$(frauci-get-version)
fi
deploy:
provider: releases
api_key: "$GITHUB_RELEASE_TOKEN"
on:
tags: true
env:
global:
- OWNER_NAME=BrightspaceUI
- REPO_NAME=offscreen
- SAUCE_USERNAME: Desire2Learn
- secure: RtWC2uMUHvox7Y/qdWd7wrxEYedg1MdnZp9aoI2jL8KP4gi/efeFhzBIjIShnv6hnkJdf7Vy+5PTwgp4q6i4HZzmIAjyEGX+J5xd8emd3yrYg2puBrKI4bE+qzjnrWsc/9tbeqbRviFZzJzLzGCz9t1H3m/USKnzU71z7M3lFlA=
- secure: QZCXkJJHV+dL29b829G9Mluib5o0KcZTl6SQIZ2VhVDAndHE+B1Ng8pO4X3LFvb1qzvcjZTuoygByuDGjAhYcWRAfsghwHDs4iWG3De4Df7YDVPyMoD5qTJnqJoCq1JV5l6++RpGSN7sjcZGLQnZN7lip73vQDbN+3YeKbBl6QA=
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,12 @@ npm test
[bower-image]: https://img.shields.io/bower/v/d2l-offscreen.svg
[ci-image]: https://travis-ci.org/BrightspaceUI/offscreen.svg?branch=master
[ci-url]: https://travis-ci.org/BrightspaceUI/offscreen
## Versioning
Commits and PR merges to master will automatically do a minor version bump which will:
* Update the version in `package.json`
* Add a tag matching the new version
* Create a github release matching the new version
By using either **[increment major]** or **[increment patch]** notation inside your merge message, you can overwrite the default version upgrade of minor to the position of your choice.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@
"eslint": "^4.15.0",
"eslint-config-brightspace": "^0.4.0",
"eslint-plugin-html": "^4.0.1",
"frau-ci": "^1.33.2",
"polymer-cli": "^1.9.1",
"sauce-connect-launcher": "^1.2.4",
"wct-browser-legacy": "^1.0.1"
},
"version": "",
"version": "4.0.4",
"resolutions": {
"inherits": "2.0.3",
"samsam": "1.1.3",
Expand Down

0 comments on commit 53f0ca2

Please sign in to comment.