Skip to content

Commit b0d2962

Browse files
committed
updated deployment workflow
1 parent bb6f662 commit b0d2962

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ karma.conf.js
99
.editorconfig
1010
browserslist
1111
.cache
12+
travis
1213
.travis.yml
1314
tests
1415
tsconfig.json

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ addons:
99
firefox: latest
1010
script:
1111
- yarn test
12+
before_deploy:
13+
- export DIST_TAG=$(node travis/getNpmDistTag.js)
14+
- "echo NPM DIST TAG: $DIST_TAG"
1215
deploy:
1316
provider: npm
1417
@@ -19,3 +22,4 @@ deploy:
1922
repo: ZeeCoder/use-resize-observer
2023
branch: master
2124
skip_cleanup: true
25+
tag: ${DIST_TAG}

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## 6.2.0-alpha1
3+
## 6.2.0-alpha.1
44

55
- Only instantiating a ResizeObserver instance if there's actually something to
66
observe. This for example means that if you pass in `null` or undefined as the
@@ -26,17 +26,17 @@
2626

2727
- No changes, only publishing the next minor.
2828

29-
## 6.1.0-alpha3
29+
## 6.1.0-alpha.3
3030

3131
- Fixed SSR rendering, and added a test to cover it.
3232

33-
## 6.1.0-alpha2
33+
## 6.1.0-alpha.2
3434

3535
- ResizeObserver instances are no longer created unnecessarily when the onResize
3636
callback changes. (Fixes #32)
3737
- Written new tests in [react testing library](https://github.com/testing-library/react-testing-library).
3838

39-
## 6.1.0-alpha1
39+
## 6.1.0-alpha.1
4040

4141
- Rewrote the source in TypeScript. (Feedback is welcome.)
4242
- Rewrote tests in TypeScript as well. (Ensures the types make sense.)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "use-resize-observer",
3-
"version": "6.2.0-alpha1",
3+
"version": "6.2.0-alpha.1",
44
"main": "dist/bundle.cjs.js",
55
"module": "dist/bundle.esm.js",
66
"types": "dist/index.d.ts",

travis/getNpmDistTag.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env node
2+
3+
const version = require("../package.json").version;
4+
5+
// Extracting the dist tag, assuming that it would look something like this:
6+
// `1.2.3-alpha.1`
7+
const matches = version.match(/^[^-]*-([^.]+).*$/);
8+
9+
// "latest" is default.
10+
// See: https://docs.npmjs.com/adding-dist-tags-to-packages
11+
const distTag = matches ? matches[1] : "latest";
12+
13+
process.stdout.write(distTag);

0 commit comments

Comments
 (0)