Skip to content

Commit fd6fc98

Browse files
authored
Merge pull request #30 from nut-tree/feature/4/snapshot_release
Feature/4/snapshot release
2 parents dce87eb + 31335cf commit fd6fc98

9 files changed

+63
-26
lines changed

Diff for: .build/pre-release.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$timestamp = Get-Date -Format yyyyMMddhhmmss
2+
$patchVersion = (npm --no-git-tag version patch)
3+
$nextVersion = "${patchVersion}-next.${timestamp}".Substring(1)
4+
echo $nextVersion
5+
6+
npm version --no-git-tag -f $nextVersion
7+
npm run publish:next

Diff for: .build/pre-release.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
patchVersion=$(npm --no-git-tag version patch)
5+
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
6+
echo "${nextVersion:1}"
7+
8+
npm version --no-git-tag -f "${nextVersion:1}"
9+
npm run publish:next

Diff for: .build/release.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm publish

Diff for: .build/release.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
npm publish

Diff for: .travis.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,29 @@ install: true
3636

3737
script:
3838
- npm run patch && npm i
39-
- if [[ $TRAVIS_OS_NAME = "windows" ]]; then npm run build:release:win; else npm run build:release; fi
39+
- npm run build:release
4040
- cd test
4141
- npm cit
4242
- cd window-integration-tests
4343
- npm cit
4444
- cd ../..
4545

46+
stages:
47+
- test
48+
- name: deploy
49+
if: (branch = develop) OR (tag IS present)
50+
4651
before_deploy:
4752
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
4853

4954
deploy:
5055
- provider: script
51-
skip_cleanup: true
52-
script: npm publish --access public
56+
skip_cleanup: false
57+
script: bash ./.build/pre-release.sh
58+
on:
59+
branch: develop
60+
- provider: script
61+
skip_cleanup: false
62+
script: bash ./.build/release.sh
5363
on:
5464
tags: true
55-
node_js: '12'
56-

Diff for: README.md

-14
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,9 @@ npm install
2222
npm run build:release
2323
```
2424

25-
Installation and build on Windows
26-
27-
```
28-
npm install
29-
npm run build:release:win
30-
```
31-
3225
### Debug build
3326

3427
```
3528
npm install
3629
npm run build:debug
3730
```
38-
39-
Installation and build on Windows
40-
41-
```
42-
npm install
43-
npm run build:debug:win
44-
```

Diff for: appveyor.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ image: Visual Studio 2017
55
# Test against these versions of Io.js and Node.js.
66
environment:
77
matrix:
8-
# node.js
9-
- nodejs_version: "10"
8+
- nodejs_version: "12"
109

1110
cache:
1211
- node_modules
@@ -25,7 +24,7 @@ install:
2524
- ps: '"//registry.npmjs.org/:_authToken=$env:npm_auth_token`n" | out-file "$env:userprofile\.npmrc" -Encoding ASCII'
2625
- npm whoami
2726
- npm run patch && npm install
28-
- npm run build:release:win
27+
- npm run build:release
2928

3029
test_script:
3130
# Output useful info for debugging.
@@ -42,5 +41,15 @@ test_script:
4241
on_success:
4342
- IF defined APPVEYOR_REPO_TAG_NAME npm publish
4443

44+
deploy:
45+
- provider: script
46+
path: ./.build/release.ps1
47+
on:
48+
APPVEYOR_REPO_TAG: true
49+
- provider: script
50+
path: ./.build/pre-release.ps1
51+
on:
52+
branch: develop
53+
4554
build: off
4655
version: "{build}"

Diff for: package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
"scripts": {
88
"clean": "cmake-js clean",
99
"patch": "node ./patch-packagename.js",
10-
"build:debug": "cmake-js rebuild --debug",
11-
"build:debug:win": "cmake-js rebuild --debug -G \"Visual Studio 15 2017 Win64\"",
12-
"build:release": "cmake-js rebuild",
13-
"build:release:win": "cmake-js rebuild -G \"Visual Studio 15 2017 Win64\""
10+
"build:debug": "run-script-os",
11+
"build:debug:default": "cmake-js rebuild --debug",
12+
"build:debug:win32": "cmake-js rebuild --debug -G \"Visual Studio 15 2017 Win64\"",
13+
"build:release": "run-script-os",
14+
"build:release:default": "cmake-js rebuild",
15+
"build:release:win32": "cmake-js rebuild -G \"Visual Studio 15 2017 Win64\"",
16+
"prepublishOnly": "npm run build:release",
17+
"publish:next": "npm publish --tag next"
1418
},
1519
"repository": {
1620
"type": "git",
@@ -41,5 +45,8 @@
4145
},
4246
"engines": {
4347
"node": ">=10.15.3"
48+
},
49+
"devDependencies": {
50+
"run-script-os": "1.1.1"
4451
}
4552
}

0 commit comments

Comments
 (0)