From f2599a0e722a885c0c2e1f10fdd59a9623b3c8af Mon Sep 17 00:00:00 2001 From: Jason Frerich Date: Mon, 1 Jun 2020 17:06:47 -0500 Subject: [PATCH] replace build-and-release workflow with ci-build (#58) --- .circleci/config.yml | 92 +++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 53 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 51a19fb..1c26fb2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,65 +1,51 @@ -version: 2.0 -jobs: - build: - docker: - - image: circleci/golang:1.13-node - working_directory: /go/src/github.com/mattermost/mattermost-plugin-confluence - steps: - - checkout - - restore_cache: - key: go-mod-v1-{{ checksum "go.sum" }} - - type: shell - name: 'Checks the code style, tests, builds and bundles the plugin.' - command: make all - environment: - TERM: dumb - - save_cache: - key: go-mod-v1-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - - store_artifacts: - path: ./dist - destination: build - - persist_to_workspace: - root: . - paths: - - dist - release: - docker: - - image: cibuilds/github:0.12 - working_directory: /go/src/github.com/mattermost/mattermost-plugin-confluence - steps: - - checkout - - 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/ +version: 2.1 + +orbs: + plugin-ci: mattermost/plugin-ci@volatile workflows: - version: 2 - build: + ci-build: jobs: - - build: + - plugin-ci/lint: filters: - branches: - only: /.*/ tags: - ignore: /.*/ - build-and-release: - jobs: - - build: + only: /^v.*/ + - plugin-ci/test: + filters: + tags: + only: /^v.*/ + - plugin-ci/build: filters: - branches: - ignore: /.*/ tags: - only: /.*/ - - release: + only: /^v.*/ + - plugin-ci/deploy-ci: + filters: + branches: + only: master + context: plugin-ci requires: - - build + - plugin-ci/lint + - plugin-ci/test + - plugin-ci/build + - plugin-ci/deploy-release: filters: + tags: + only: /^v.*/ branches: ignore: /.*/ + context: plugin-ci + requires: + - plugin-ci/lint + - plugin-ci/test + - plugin-ci/build + - plugin-ci/deploy-release-github: + filters: tags: - only: /.*/ + only: /^v.*/ + branches: + ignore: /.*/ + context: matterbuild-github-token + requires: + - plugin-ci/lint + - plugin-ci/test + - plugin-ci/build