Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit e189d6b

Browse files
author
Kent C. Dodds
committed
fix(build): Add publish:latest 🐳
Add authorize-push script by @boennemann so travis can push changes which is run as a pre-script, then publish:latest runs to checkout the latest branch, commit the built files and move the tag (which totally works with the github release, crazy, I know). #445
1 parent 07d199e commit e189d6b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
"report-coverage": "cat ./coverage/lcov.info | node_modules/.bin/codecov",
2929
"code-checks": "eslint src/",
3030
"commit": "git-cz",
31-
"semantic-release": "semantic-release pre && npm run build && npm publish && semantic-release post"
31+
"prepublish:latest": "node scripts/authorize-push.js",
32+
"publish:latest": "git checkout latest && git add dist && with-package git commit -m pkg.version && with-package F_VERSION=pkg.version git tag v${F_VERSION} -f && git push origin latest --tags -f",
33+
"semantic-release": "semantic-release pre && npm run build && npm publish && semantic-release post && npm run publish:latest"
3234
},
3335
"betterScripts": {
3436
"build:dist": {

scripts/authorize-push.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var exec = require('child_process').exec
2+
3+
var GH_TOKEN = process.env.GH_TOKEN
4+
var repo = require('../package.json').repository.url
5+
6+
if (!(process.env.CI && GH_TOKEN && repo)) {
7+
process.exit(1)
8+
}
9+
10+
exec('git remote set-url origin ' + repo.replace('https://', 'https://' + GH_TOKEN + '@') + ' && ');
11+
exec('git config user.email formly-js@angular-formly.com && ');
12+
exec('git config user.name "formly-bot"');

0 commit comments

Comments
 (0)