]> git.r.bdr.sh - rbdr/mobius/blame - .circleci/config.yml
Troubleshoot build pipeline
[rbdr/mobius] / .circleci / config.yml
CommitLineData
6988a057
JH
1# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
2version: 2.1
3jobs:
4 build:
5 working_directory: ~/repo
6 docker:
46acf072 7 - image: cimg/go:1.19.1
6988a057
JH
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:
46acf072 30 - image: cimg/go:1.19.1
6988a057
JH
31# working_directory: /go/src/github.com/jhalter/mobius
32 steps:
33 - checkout
34 - run: go get -u github.com/mitchellh/gox
75019849 35 - run: go get -u github.com/tcnksm/ghr
337f6600 36 # - run: find / -name ghr
46acf072 37 - run: go install github.com/stevenmatthewt/semantics@latest
6988a057
JH
38 - run:
39 name: cross compile
40 command: |
558cd82d 41 make all
6988a057
JH
42 - add_ssh_keys
43 - run:
44 name: create release
45 command: |
46acf072 46 tag=$(/home/circleci/go/bin/semantics --output-tag)
337f6600
JH
47
48 # wat??
49 ghr=$(/home/circleci/go/pkg/mod/cache/download/github.com/tcnksm/ghr)
50
6988a057 51 if [ "$tag" ]; then
0620da73 52 /home/circleci/go/bin/ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $tag dist/
6988a057
JH
53 else
54 echo "The commit message(s) did not indicate a major/minor/patch version."
55 fi
56
57workflows:
58 version: 2
59 build-deploy:
60 jobs:
61 - build
62 - deploy:
63 requires:
64 - build
65 filters:
66 branches:
67 only: master