This repository was archived by the owner on Feb 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from acacode/next-release
Next release 3.0.0-alpha.1
- Loading branch information
Showing
35 changed files
with
5,291 additions
and
18,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
es | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# production files | ||
dist | ||
lib | ||
es | ||
|
||
|
||
# other | ||
node_modules | ||
yarn-error.log | ||
*.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,60 @@ | ||
|
||
language: node_js | ||
node_js: | ||
- "node" | ||
|
||
cache: | ||
yarn: true | ||
directories: | ||
- "node_modules" | ||
- "node_modules" | ||
|
||
before_install: | ||
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
- export PACKAGE_VERSION=$(node -p "require('./package.json').version") | ||
- export NPM_REMOTE_VERSION=$(npm view kinka version) | ||
- export PACKAGE_NAME=$(node -p "require('./package.json').name") | ||
- export BRANCH_IS_TAG=$(node -p "/^([0-9].[0-9].[0-9]+((-(alpha|beta))|))$/.test('${TRAVIS_BRANCH}')") | ||
- export GIT_LOG="$(git log --pretty=format:"* %s (%h)")" | ||
- export PROJECT_NAME="acacode/kinka" | ||
- export RELEASE_BODY=$(node -p "'[Click here to see release changes](https://github.com/$PROJECT_NAME/blob/$TRAVIS_BRANCH/CHANGELOG.md#' + require('./bin/getLatestTag.js') + ')'") | ||
|
||
install: | ||
- yarn | ||
script: | ||
- yarn lint | ||
- yarn unit-test | ||
- yarn build | ||
after_success: | ||
- ls -l | ||
- git remote rm origin | ||
- git remote add origin https://js2me:${GITHUB_TOKEN}@github.com/acacode/kinka.git | ||
- git remote set-url origin https://js2me:${GITHUB_TOKEN}@github.com/acacode/kinka.git | ||
- git fetch -p | ||
- git fetch | ||
- git symbolic-ref HEAD refs/heads/${TRAVIS_BRANCH} | ||
- git symbolic-ref HEAD | ||
- git remote show origin | ||
- git status | ||
- if [ ${TRAVIS_BRANCH} = "master" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ];then | ||
git add dist && git commit -m "build release ${PACKAGE_VERSION} [ci skip]"; | ||
git push --set-upstream origin ${TRAVIS_BRANCH}; | ||
yarn git-release ${PACKAGE_VERSION}; | ||
rm -rf test; | ||
npm publish; | ||
rm -rf dist; | ||
git add dist && git commit -m "remove dist folder [ci skip]"; | ||
git push --set-upstream origin ${TRAVIS_BRANCH}; | ||
fi | ||
- npm ci | ||
|
||
jobs: | ||
include: | ||
- stage: lint | ||
script: npm run lint | ||
- stage: test | ||
script: | ||
- npm run build | ||
- npm run test | ||
- stage: publish | ||
if: env(BRANCH_IS_TAG) != true AND branch = master AND type = push | ||
name: "Create Github Release" | ||
before_deploy: | ||
- git config --global user.email "builds@travis-ci.com" | ||
- git config --global user.name "Travis CI" | ||
- git tag $PACKAGE_VERSION -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER from $TRAVIS_BRANCH" | ||
- git push -q https://$GITHUB_TOKEN@github.com/$PROJECT_NAME --tags | ||
- zip -r release.zip dist lib es src index.d.ts LICENSE README.md package.json | ||
- ls -l | ||
deploy: | ||
provider: releases | ||
name: "Release ${PACKAGE_VERSION}" | ||
body: "$RELEASE_BODY" | ||
overwrite: true | ||
skip_cleanup: true | ||
api_key: | ||
secure: ${GITHUB_TOKEN} | ||
file: | ||
- release.zip | ||
on: | ||
all_branches: true | ||
repo: $PROJECT_NAME | ||
after_deploy: | ||
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
- npm publish | ||
|
||
notifications: | ||
slack: | ||
rooms: | ||
secure: t9LO6BExYzs4mElFgeeVhoDC01t9tg/L/6extSBqIQmJzvVNQaOMiZh6QYUg9wmnzVU4FqjoVeuMrR7bMrlzek2jvC7bPYHwnWCN86QFcbtnr8IApYhxLWmByDWruxcTbBhkTHzkyBJJboaZXnk0zcJhcsRkFYntUwBo/PTuYnQvZoAh/vQqRDoVQEUa+4dp+W3Muu7TTit06t+T4Qxk4wtoGd1ehVUoi4e/UONa7Ykm4QyQz16vksjz4loHly8aJ6hP4KP89vqksC1bGzn15StvA4YHBvg0PDrHcqGwVHtZUkD72CzKB7C96TFIojej+wh+MDX8SR9GDRpqlKNblCcbm+pObHPkvESC3+w9uZJAyLgoA398zp0sPt3RYZ37Rz+RXUx3Vnlu6t7IM+Bo6q6ZlivmiYKUujoX91cbBiMu2dOXWAtgVV3+qpsskUOEi8cm/O1/kuM/n2pjsgU4AYqE+f2rRNd9OeXHQoEr+j56PqgOcOOGdzOi8IxfpCfVSrrePHvTE534FbAySEbpX+Ulk1nuFzj6ort0DfYKDU8SxFCmfOl42BiCg/T4e5dxP9plpnBHBFJYNqqfcLIu9o2RsXILSAtoawzvrsBN3wxgeFmSJ9dMARODSRNGmeROwBDyT7y03gJcmxYT4UI8DsXkTEBANv/IfinbeBGrMo4= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
env: { | ||
build: { | ||
presets: ['@babel/preset-env'], | ||
}, | ||
test: { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current', | ||
}, | ||
}, | ||
], | ||
], | ||
}, | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const changelog = fs.readFileSync(path.resolve(__dirname, '../CHANGELOG.md')) | ||
const latestVersionRow = changelog | ||
.toString() | ||
.split(/(\r\n)|(\n)/g) | ||
.filter( | ||
str => str && str.startsWith('## ') && !str.startsWith('## [VERSION]') | ||
)[0] | ||
|
||
if (!latestVersionRow) { | ||
throw Error('Nothing any versions in changelog') | ||
} | ||
|
||
module.exports = latestVersionRow.split(/\[|\]/g)[1].replace(/\./g, '') |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.