Skip to content

Commit 95857c0

Browse files
authored
Add automatic publish to NPM
- Release will run on master only - Automatic version check - avoid trying to publish already released version - Automatic publish to NPM as a last step in the matrix @MatthD , could you please add npm_auth_token env variable to appveyor secrets config, so that new version is automatically published to NPM after version increase in package json
1 parent 3a2c023 commit 95857c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ environment:
2626
nan_version: 2.7.0
2727
pre_gyp_version: 0.6.39
2828
pre_gyp_github_version: 1.3.0
29+
publish_to_npm: true
2930

3031
cache:
3132
- '%APPDATA%\npm-cache'
@@ -36,6 +37,7 @@ install:
3637
- npm i nan@%nan_version%
3738
- npm install -g node-pre-gyp@%pre_gyp_version%
3839
- npm install -g node-pre-gyp-github@%pre_gyp_github_version%
40+
- ps: "//registry.npmjs.org/:_authToken=$env:npm_auth_token`n" | out-file "$env:userprofile\.npmrc" -Encoding ASCII
3941

4042
build_script:
4143
- node-pre-gyp configure
@@ -63,6 +65,9 @@ for:
6365
git config --global user.email "[email protected]"
6466
git config --global user.name "MatthD"
6567
node-pre-gyp-github publish --release
68+
if ($env:publish_to_npm){
69+
npm publish
70+
}
6671
}else
6772
{
6873
Write-Host "NODE_PRE_GYP_GITHUB_TOKEN missing. Not authorised to perform release."

0 commit comments

Comments
 (0)