Skip to content

Commit 17ae1df

Browse files
committed
Add deployment script to repository
1 parent 811c6a8 commit 17ae1df

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

circle.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ dependencies:
1010

1111
pre:
1212
- yarn --version
13+
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
1314

1415
override:
1516
- script/update
1617

1718
test:
1819
override:
1920
- script/test
21+
22+
deployment:
23+
release:
24+
tag: /v[0-9]+(\.[0-9]+)*/
25+
owner: jessedijkstra
26+
commands:
27+
- script/deploy

package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,28 @@
33
"version": "0.0.1",
44
"description": "Simple configuration and step definitions for Cucumber.js and Webdriver.io",
55
"main": "index.js",
6+
"keywords": [
7+
"wdio",
8+
"webdriver",
9+
"cucumber",
10+
"BDD"
11+
],
612
"repository": {
713
"url": "https://github.com/jessedijkstra/wdio-cucumber-utilities.git",
814
"type": "git"
915
},
10-
"engines" : {
11-
"node" : ">=6.9.1"
16+
"engines": {
17+
"node": ">=6.9.1"
1218
},
1319
"scripts": {
1420
"test": "script/test"
1521
},
1622
"author": "Jesse Dijkstra <mail@jessedijkstra.nl>",
23+
"contributors": [
24+
"Christian Bromann <christian@saucelabs.com>"
25+
],
26+
"homepage": "https://github.com/jessedijkstra/wdio-cucumber-utilities",
27+
"bugs": "https://github.com/jessedijkstra/wdio-cucumber-utilities/issues",
1728
"license": "MIT",
1829
"dependencies": {
1930
"chai": "^3.5.0",
@@ -30,6 +41,7 @@
3041
"eslint-config-airbnb-base": "^10.0.1",
3142
"eslint-plugin-import": "^2.2.0",
3243
"http-server": "^0.9.0",
33-
"selenium-standalone": "^5.8.0"
44+
"selenium-standalone": "^5.8.0",
45+
"semver": "^5.3.0"
3446
}
3547
}

script/deploy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
NPM_PACKAGE_VERSION=$(semver $(node -p -e "require('./package.json').version"))
4+
GIT_TAG_VERSION=$(semver $(git describe --tags || echo "0.0.0"))
5+
6+
if [ $NPM_PACKAGE_VERSION != $GIT_TAG_VERSION ]; then
7+
echo "Error: NPM package version $NPM_PACKAGE_VERSION does not match the GIT tag version $GIT_TAG_VERSION"
8+
exit 1
9+
fi
10+
11+
npm publish

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,10 @@ selenium-standalone, selenium-standalone@^5.6.0:
18851885
which "1.1.1"
18861886
yauzl "^2.5.0"
18871887

1888+
semver:
1889+
version "5.3.0"
1890+
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
1891+
18881892
sentence-case@^2.1.0:
18891893
version "2.1.0"
18901894
resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-2.1.0.tgz#d592fbed457fd1a59e3af0ee17e99f6fd70d7efd"

0 commit comments

Comments
 (0)