Commit 050948a4 authored by William Naslund's avatar William Naslund

Added NPM publish job for tags

parent 775ade0b
......@@ -63,3 +63,33 @@ pages:
paths:
- public
expire_in: 1 day
NPM Publish Alpha:
stage: deploy
image: node:11
only:
- tags
- /^\d+\.\d+\.\d+\-alpha\.\d+$/
script:
- node scripts/set-version.js "$CI_COMMIT_TAG"
- npm publish --tag alpha --access public
NPM Publish Beta:
stage: deploy
image: node:11
only:
- tags
- /^\d+\.\d+\.\d+\-beta\.\d+$/
script:
- node scripts/set-version.js "$CI_COMMIT_TAG"
- npm publish --tag beta --access public
NPM Publish Release:
stage: deploy
image: node:11
only:
- tags
- /^\d+\.\d+\.\d+$/
script:
- node scripts/set-version.js "$CI_COMMIT_TAG"
- npm publish --access public
{
"name": "@swirl/db",
"version": "1.0.0-alpha.1",
"main": "dist/module/index.js",
"scripts": {
"start": "concurrently npm:watch:module npm:watch:tests",
"prepublish": "rm -rf dist && tsc && rm -rf dist/tests",
"test": "mocha --require module-alias/register --recursive dist/tests",
"test:one": "mocha --require module-alias/register $1",
"test:coverage": "nyc --reporter=html --reporter=text-summary mocha --require module-alias/register --recursive dist/tests",
"watch:module": "tsc -w --preserveWatchOutput",
"watch:tests": "tsc -p tests/ -w --preserveWatchOutput",
"build:module": "tsc",
"build:tests": "tsc -p tests/"
},
"_moduleAliases": {
"@swirl/db": "./dist/module"
},
"dependencies": {
"pg": "^7.8.0",
"pg-cursor": "^2.0.0",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.18",
"@types/pg": "^7.4.11",
"concurrently": "^4.1.0",
"mocha": "^5.2.0",
"module-alias": "^2.1.0",
"nyc": "^13.2.0",
"typescript": "^3.2.4"
}
}
"name": "@swirl/db",
"main": "dist/module/index.js",
"scripts": {
"start": "concurrently npm:watch:module npm:watch:tests",
"prepublish": "rm -rf dist && tsc && rm -rf dist/tests",
"test": "mocha --require module-alias/register --recursive dist/tests",
"test:one": "mocha --require module-alias/register $1",
"test:coverage": "nyc --reporter=html --reporter=text-summary mocha --require module-alias/register --recursive dist/tests",
"watch:module": "tsc -w --preserveWatchOutput",
"watch:tests": "tsc -p tests/ -w --preserveWatchOutput",
"build:module": "tsc",
"build:tests": "tsc -p tests/"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://git.starlightconsultants.com/swirl/db.git"
},
"_moduleAliases": {
"@swirl/db": "./dist/module"
},
"dependencies": {
"pg": "^7.8.0",
"pg-cursor": "^2.0.0",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.18",
"@types/pg": "^7.4.11",
"concurrently": "^4.1.0",
"mocha": "^5.2.0",
"module-alias": "^2.1.0",
"nyc": "^13.2.0",
"typescript": "^3.2.4"
}
}
\ No newline at end of file
const fs = require('fs');
const path = require('path');
const PACKAGE_PATH = path.resolve(__dirname, '..', 'package.json');
const package = JSON.parse(fs.readFileSync(PACKAGE_PATH));
package.version = process.argv[2];
fs.writeFileSync(PACKAGE_PATH, JSON.stringify(package, null, ' '));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment