|
|
@@ -81,27 +81,49 @@ build-dev:
|
|
|
npm run build:dev
|
|
|
|
|
|
|
|
|
-release-to-github: # would be run on release branch
|
|
|
+create-branch-for-release: # would be run on release branch
|
|
|
steps:
|
|
|
- script:
|
|
|
- name: set yarn cache-folder
|
|
|
- code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
|
|
|
+ name: bump version
|
|
|
+ code: |
|
|
|
+ git config --global user.name "wercker"
|
|
|
+ git config --global user.email "info@weseek.co.jp"
|
|
|
+ # npm version to bump version
|
|
|
+ npm version patch
|
|
|
+ # export $RELEASE_VERSION
|
|
|
+ export RELEASE_VERSION=`npm run version --silent`
|
|
|
+ echo "export RELEASE_VERSION=$RELEASE_VERSION"
|
|
|
|
|
|
- script:
|
|
|
- name: install dependencies
|
|
|
+ name: push to github to create new branch
|
|
|
code: |
|
|
|
- yarn global add npm@4
|
|
|
- # add assets-webpack-plugin individually
|
|
|
- # because `yarn install` couldn't find package from the "npm" registry
|
|
|
- yarn add assets-webpack-plugin
|
|
|
- yarn install --production
|
|
|
+ # reconfigure origin
|
|
|
+ GITHUB_ORIGIN=https://yuki-takei:$GITHUB_TOKEN@$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY.git
|
|
|
+ git remote set-url origin $GITHUB_ORIGIN
|
|
|
+ git checkout -B tmp/release-$RELEASE_VERSION
|
|
|
+ git push -u origin HEAD:tmp/release-$RELEASE_VERSION
|
|
|
+
|
|
|
|
|
|
+release-to-github: # would be run on temporary release branch
|
|
|
+ steps:
|
|
|
- script:
|
|
|
- name: bump version
|
|
|
+ name: get version
|
|
|
code: |
|
|
|
- npm version patch
|
|
|
- RELEASE_VERSION=`npm run version --silent`
|
|
|
+ export RELEASE_VERSION=`npm run version --silent`
|
|
|
+ echo "export RELEASE_VERSION=$RELEASE_VERSION"
|
|
|
|
|
|
- github-create-release:
|
|
|
token: $GITHUB_TOKEN
|
|
|
- tag: $RELEASE_VERSION
|
|
|
+ tag: v$RELEASE_VERSION
|
|
|
+
|
|
|
+ - script:
|
|
|
+ name: remove temporary release branch
|
|
|
+ code: |
|
|
|
+ git config --global user.name "wercker"
|
|
|
+ git config --global user.email "info@weseek.co.jp"
|
|
|
+ # reconfigure origin
|
|
|
+ GITHUB_ORIGIN=https://yuki-takei:$GITHUB_TOKEN@$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY.git
|
|
|
+ git remote rm origin
|
|
|
+ git remote add origin $GITHUB_ORIGIN
|
|
|
+ # remove branch
|
|
|
+ git push --delete origin $WERCKER_GIT_BRANCH
|