Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
masa213f committed Sep 28, 2019
1 parent fa35aa5 commit 405155f
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ jobs:
- run:
name: Install commands
command: |
# semver
go get -u github.com/masa213f/semver/cmd/semver
# hub
HUB_VERSION=2.12.7
curl -sSLf -O https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz
tar zxf hub-linux-amd64-${HUB_VERSION}.tgz --strip-components=1 -C /tmp/
- run:
name: Confirm the release version
command: |
Expand All @@ -43,12 +48,6 @@ jobs:
git add version.txt
git commit -m "[ci skip] Bump version to ${RELEASE_VERSION}"
git push --set-upstream origin ${CIRCLE_BRANCH}
- run:
name: Install hub
command: |
HUB_VERSION=2.12.7
curl -sSLf -O https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz
tar zxf hub-linux-amd64-${HUB_VERSION}.tgz --strip-components=1 -C /tmp/
- run:
name: Create a pull request
command: |
Expand All @@ -73,7 +72,10 @@ jobs:
- run:
name: Add release tag
command: |
git tag $(cat version.txt)
RELEASE_TAG=v$(cat version.txt)
echo "Tag: ${RELEASE_TAG}"
git tag ${RELEASE_TAG}
git push --set-upstream origin ${RELEASE_TAG}
release_in_github:
docker:
Expand All @@ -86,25 +88,26 @@ jobs:
fingerprints:
- "80:1b:4c:08:a8:82:17:dc:fc:f5:e4:6a:c8:60:67:f4"
- run:
name: Install semver
name: Install commands
command: |
# semver
go get -u github.com/masa213f/semver/cmd/semver
# hub
HUB_VERSION=2.12.7
curl -sSLf -O https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz
tar zxf hub-linux-amd64-${HUB_VERSION}.tgz --strip-components=1 -C /tmp/
- run:
name: Build and output the program version
command: |
RELEASE_VERSION=$(cat version.txt)
make build
./semver --version
mv semver /tmp/release/semver-linux-amd64-v${RELEASE_VERSION}
- run:
name: Install hub
command: |
HUB_VERSION=2.12.7
curl -sSLf -O https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz
tar zxf hub-linux-amd64-${HUB_VERSION}.tgz --strip-components=1 -C /tmp/
mv semver semver-linux-amd64-v${RELEASE_VERSION}
- run:
name: Release as draft
command: |
set -x
RELEASE_VERSION=$(cat version.txt)
if semver -p "${RELEASE_VERSION}"; then
PRE_OPT=-p
fi
Expand All @@ -119,17 +122,15 @@ workflows:
filters:
branches:
only:
- develop
- /^feature/.*/
- develop
- /^feature/.*/
release:
jobs:
- run_test:
filters:
branches:
only: /^release-v.*/
- create_release_pr:
requires:
- run_test
filters:
branches:
only: /^release-v.*/
Expand All @@ -140,6 +141,8 @@ workflows:
branches:
only: master
- release_in_github:
requires:
- add_release_tag
filters:
branches:
only: master

0 comments on commit 405155f

Please sign in to comment.