]> git.r.bdr.sh - rbdr/mobius/blob - .circleci/config.yml
Troubleshoot build pipeline
[rbdr/mobius] / .circleci / config.yml
1 # Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
2 version: 2.1
3 jobs:
4 build:
5 working_directory: ~/repo
6 docker:
7 - image: cimg/go:1.19.1
8 steps:
9 - checkout
10 # - restore_cache:
11 # keys:
12 # - go-mod-v4-{{ checksum "go.sum" }}
13 - run:
14 name: Install Dependencies
15 command: go mod download
16 # - save_cache:
17 # key: go-mod-v4-{{ checksum "go.sum" }}
18 # paths:
19 # - "/go/pkg/mod"
20 - run:
21 name: Run tests
22 command: |
23 mkdir -p /tmp/test-reports
24 gotestsum --junitfile /tmp/test-reports/unit-tests.xml
25 - store_test_results:
26 path: /tmp/test-reports
27
28 deploy:
29 docker:
30 - image: cimg/go:1.19.1
31 # working_directory: /go/src/github.com/jhalter/mobius
32 steps:
33 - checkout
34 - run: go get -u github.com/mitchellh/gox
35 - run: go get -u github.com/tcnksm/ghr
36 # - run: find / -name ghr
37 - run: go install github.com/stevenmatthewt/semantics@latest
38 - run:
39 name: cross compile
40 command: |
41 make all
42 - add_ssh_keys
43 - run:
44 name: create release
45 command: |
46 tag=$(/home/circleci/go/bin/semantics --output-tag)
47
48 # wat??
49 ghr=$(/home/circleci/go/pkg/mod/cache/download/github.com/tcnksm/ghr)
50
51 if [ "$tag" ]; then
52 /home/circleci/go/bin/ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $tag dist/
53 else
54 echo "The commit message(s) did not indicate a major/minor/patch version."
55 fi
56
57 workflows:
58 version: 2
59 build-deploy:
60 jobs:
61 - build
62 - deploy:
63 requires:
64 - build
65 filters:
66 branches:
67 only: master