Skip to content

Commit f70c581

Browse files
Add files via upload
1 parent bb35932 commit f70c581

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:8.8.0-alpine
2+
3+
WORKDIR .
4+
5+
COPY . .
6+
7+
RUN ["chmod", "+x", "run.sh"]
8+
9+
ENTRYPOINT ["sh","run.sh"]
10+
11+

npm-publish.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env node
2+
3+
const npm = require('npm-utils');
4+
process.argv.NPM_TOKEN = '69940e2b-01db-4b58-9fb4-5572ef814016';
5+
6+
7+
function onError (err) {
8+
console.error(err);
9+
process.exit(-1)
10+
}
11+
12+
npm.setAuthToken()
13+
.then(npm.publish)
14+
.catch(onError);

package.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"name": "publish-for-npm",
3+
"version": "1.0.2",
4+
"description": "Let the CI do the `npm publish` step after the build passes",
5+
"main": "index.js",
6+
"bin": {
7+
"npm-publish": "bin/npm-publish.js"
8+
},
9+
"files": [
10+
"bin",
11+
"src"
12+
],
13+
"scripts": {
14+
"test": "npm run lint",
15+
"commit": "simple-commit-message",
16+
"lint": "standard bin/*.js src/*.js",
17+
"npm-publish": "node bin/npm-publish.js",
18+
"ban": "node --harmony node_modules/.bin/ban",
19+
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
20+
"run": "./run.sh"
21+
},
22+
"repository": {
23+
"type": "git",
24+
"url": "git+https://github.com/codefresh-io/release-to-npm.git"
25+
},
26+
"keywords": [
27+
"release",
28+
"to",
29+
"npm",
30+
"utility",
31+
"build",
32+
"automatic"
33+
],
34+
"license": "MIT",
35+
"homepage": "https://github.com/codefresh-io/release-to-npm#readme",
36+
"devDependencies": {
37+
"ban-sensitive-files": "1.8.3",
38+
"pre-git": "3.10.0",
39+
"simple-commit-message": "2.1.1",
40+
"standard": "8.0.0-beta.3"
41+
},
42+
"dependencies": {
43+
"available-versions": "0.10.0",
44+
"changed-log": "0.11.0",
45+
"npm-utils": "1.7.1"
46+
},
47+
"config": {
48+
"pre-git": {
49+
"commit-msg": [],
50+
"pre-commit": [
51+
"npm run ban",
52+
"npm test"
53+
],
54+
"pre-push": [
55+
"npm run size"
56+
],
57+
"post-commit": [],
58+
"post-merge": []
59+
}
60+
}
61+
}

run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
tmpdir=$PWD
4+
DIR=${1:-$tmpdir}
5+
cd $DIR
6+
node bin/npm-publish.js

0 commit comments

Comments
 (0)