Skip to content

Commit

Permalink
deploy to GH when tag a release (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato authored and hanzei committed Mar 11, 2019
1 parent f22f01c commit 3b80f07
Showing 1 changed file with 62 additions and 9 deletions.
71 changes: 62 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,83 @@
version: 2.1
jobs:
lint:
executors:
default:
working_directory: /go/src/github.com/mattermost/mattermost-plugin-github
docker:
- image: circleci/golang:1.12-node

working_directory: /go/src/github.com/mattermost/mattermost-plugin-github
jobs:
lint:
executor:
name: default
steps:
- checkout

- run: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- run: make check-style

test:
docker:
- image: circleci/golang:1.12-node

working_directory: /go/src/github.com/mattermost/mattermost-plugin-github
executor:
name: default
steps:
- checkout

- run: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- run: make test

build:
executor:
name: default
steps:
- checkout
- run: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- run: make dist
- persist_to_workspace:
root: .
paths: ./dist/*.tar.gz

publish-github-release:
docker:
- image: cibuilds/github:0.12
steps:
- attach_workspace:
at: .
- run:
name: "Publish Release on GitHub"
command: |
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./dist/statuspage-*.tar.gz
workflows:
version: 2
untagged-build:
jobs:
- lint
- test
tagged-build:
jobs:
- lint:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- test:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- build:
requires:
- lint
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- publish-github-release:
requires:
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/

0 comments on commit 3b80f07

Please sign in to comment.