diff --git a/.circleci/config.yml b/.circleci/config.yml index 9eac99b..71ed9d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,56 +1,19 @@ -workspace_root: &workspace_root - /go/src/github.com/mattiarossi/packer-builder-oracle-ocisurrogate - -defaults: &defaults - working_directory: *workspace_root - docker: - - image: gruntwork/circle-ci-test-image-base:go1.13 - -version: 2 -jobs: - install_dependencies: - <<: *defaults - steps: - - checkout - - build: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: *workspace_root - - run: build-go-binaries --circle-ci-2 --app-name packer-builder-oracle-ocisurrogate --dest-path bin --ld-flags "-X main.VERSION=$CIRCLE_TAG" - - persist_to_workspace: - root: *workspace_root - paths: bin - - deploy: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: *workspace_root - - run: cd bin && sha256sum * > SHA256SUMS - - run: upload-github-release-assets bin/* - +# .circleci/config.yml +version: 2.1 workflows: - version: 2 - build-and-test: + main: jobs: - - install_dependencies: - filters: - tags: - only: /^v.*/ - - build: - requires: - - install_dependencies - filters: - tags: - only: /^v.*/ - - - deploy: - requires: - - build - filters: - tags: - only: /^v.*/ + - release: + # Only run this job on git tag pushes + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*(-.*)*/ +jobs: + release: + docker: + - image: circleci/golang:1.14 + steps: + - checkout + - run: curl -sL https://git.io/goreleaser | bash