Skip to content

Feature/4/snapshot release #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .build/pre-release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$timestamp = Get-Date -Format yyyyMMddhhmmss
$patchVersion = (npm --no-git-tag version patch)
$nextVersion = "${patchVersion}-next.${timestamp}".Substring(1)
echo $nextVersion

npm version --no-git-tag -f $nextVersion
npm run publish:next
9 changes: 9 additions & 0 deletions .build/pre-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -ex

patchVersion=$(npm --no-git-tag version patch)
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
echo "${nextVersion:1}"

npm version --no-git-tag -f "${nextVersion:1}"
npm run publish:next
1 change: 1 addition & 0 deletions .build/release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm publish
4 changes: 4 additions & 0 deletions .build/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -ex

npm publish
18 changes: 13 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -36,21 +36,29 @@ install: true

script:
- npm run patch && npm i
- if [[ $TRAVIS_OS_NAME = "windows" ]]; then npm run build:release:win; else npm run build:release; fi
- npm run build:release
- cd test
- npm cit
- cd window-integration-tests
- npm cit
- cd ../..

stages:
- test
- name: deploy
if: (branch = develop) OR (tag IS present)

before_deploy:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null

deploy:
- provider: script
skip_cleanup: true
script: npm publish --access public
skip_cleanup: false
script: bash ./.build/pre-release.sh
on:
branch: develop
- provider: script
skip_cleanup: false
script: bash ./.build/release.sh
on:
tags: true
node_js: '12'

14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -22,23 +22,9 @@ npm install
npm run build:release
```

Installation and build on Windows

```
npm install
npm run build:release:win
```

### Debug build

```
npm install
npm run build:debug
```

Installation and build on Windows

```
npm install
npm run build:debug:win
```
15 changes: 12 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -5,8 +5,7 @@ image: Visual Studio 2017
# Test against these versions of Io.js and Node.js.
environment:
matrix:
# node.js
- nodejs_version: "10"
- nodejs_version: "12"

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

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

deploy:
- provider: script
path: ./.build/release.ps1
on:
APPVEYOR_REPO_TAG: true
- provider: script
path: ./.build/pre-release.ps1
on:
branch: develop

build: off
version: "{build}"
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -7,10 +7,14 @@
"scripts": {
"clean": "cmake-js clean",
"patch": "node ./patch-packagename.js",
"build:debug": "cmake-js rebuild --debug",
"build:debug:win": "cmake-js rebuild --debug -G \"Visual Studio 15 2017 Win64\"",
"build:release": "cmake-js rebuild",
"build:release:win": "cmake-js rebuild -G \"Visual Studio 15 2017 Win64\""
"build:debug": "run-script-os",
"build:debug:default": "cmake-js rebuild --debug",
"build:debug:win32": "cmake-js rebuild --debug -G \"Visual Studio 15 2017 Win64\"",
"build:release": "run-script-os",
"build:release:default": "cmake-js rebuild",
"build:release:win32": "cmake-js rebuild -G \"Visual Studio 15 2017 Win64\"",
"prepublishOnly": "npm run build:release",
"publish:next": "npm publish --tag next"
},
"repository": {
"type": "git",
@@ -41,5 +45,8 @@
},
"engines": {
"node": ">=10.15.3"
},
"devDependencies": {
"run-script-os": "1.1.1"
}
}