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

Commit 56e4e07

Browse files
author
Kent C. Dodds
committed
fix(build): Fix issue with publish:latest with new script
1 parent dca5745 commit 56e4e07

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"code-checks": "eslint src/",
3030
"commit": "git-cz",
3131
"prepublish:latest": "node scripts/authorize-push.js",
32-
"publish:latest": "git fetch && git checkout -b latest origin/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",
32+
"publish:latest": "scripts/publish-latest.sh",
3333
"semantic-release": "semantic-release pre && npm run build && npm publish && semantic-release post && npm run publish:latest"
3434
},
3535
"betterScripts": {

scripts/publish-latest.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e # exit with non-zero exit code if there are failurs
3+
4+
$F_VERSION=$1
5+
echo "fetching"
6+
git fetch
7+
8+
echo "checking out"
9+
git checkout -b latest origin/latest
10+
11+
echo "adding dist"
12+
git add dist
13+
14+
echo "committing with $F_VERSION"
15+
git commit -m $F_VERSION --no-verify
16+
17+
echo "tagging with v$F_VERSION"
18+
git tag v${F_VERSION} -f
19+
20+
echo "pushing"
21+
git push origin latest --tags -f
22+
23+
echo "done!"
24+

0 commit comments

Comments
 (0)