Skip to content

Commit

Permalink
build: add automate release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 14, 2020
1 parent b15d3dc commit e50b792
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ coverage
############################
.node_history
.nyc_output
.envrc
30 changes: 27 additions & 3 deletions .travis.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
language: node_js

node_js:
- "node"
- "lts/*"
after_success: npm run coveralls
- lts/*
- node

after_success: npm run coverage

stages:
- Test
- name: Release
if: branch = master AND commit_message !~ /(release|no-release)/

jobs:
include:
- stage: Release
node_js: lts/*
install: npm install --no-package-lock
before_deploy:
- git config user.email ${GITHUB_EMAIL:-"travis@travis-ci.org"}
- git config user.name ${GITHUB_USER:-"Travis CI"}
- git remote set-url origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git checkout master
deploy:
skip_cleanup: true
provider: script
script: npm run release
on:
branch: master
40 changes: 37 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,21 @@
"sort-keys": "~4.1.0"
},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"ava": "latest",
"ci-publish": "latest",
"conventional-github-releaser": "latest",
"coveralls": "latest",
"finepack": "latest",
"git-authors-cli": "latest",
"husky": "latest",
"lint-staged": "latest",
"npm-check-updates": "latest",
"nyc": "latest",
"standard": "latest",
"standard-markdown": "latest"
"standard-markdown": "latest",
"standard-version": "latest"
},
"engines": {
"node": ">=4"
Expand All @@ -47,10 +57,34 @@
"index.js"
],
"scripts": {
"contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"lint": "standard-markdown && standard",
"postrelease": "npm run release:tags && npm run release:github && ci-publish",
"prerelease": "npm run update:check && npm run contributors",
"pretest": "npm run lint",
"test": "nyc ava --verbose"
"release": "standard-version -a",
"release:github": "conventional-github-releaser -p angular",
"release:tags": "git push --follow-tags origin HEAD:master",
"test": "nyc ava --verbose",
"update": "ncu -u",
"update:check": "ncu -- --error-level 2"
},
"license": "MIT"
"license": "MIT",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"package.json": [
"finepack"
]
}
}

0 comments on commit e50b792

Please sign in to comment.