]> git.r.bdr.sh - rbdr/mobius/blame - .circleci/config.yml
minor: v0.11.0
[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:
ea2027a3 7 - image: cimg/go:1.21.4
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:
a5520a37 30 - image: cimg/go:1.21.4
6988a057
JH
31# working_directory: /go/src/github.com/jhalter/mobius
32 steps:
33 - checkout
34 - run: go get -u github.com/mitchellh/gox
b22a7e4d 35 - run: go install github.com/tcnksm/ghr@latest
46acf072 36 - run: go install github.com/stevenmatthewt/semantics@latest
6988a057
JH
37 - run:
38 name: cross compile
39 command: |
558cd82d 40 make all
6988a057
JH
41 - add_ssh_keys
42 - run:
43 name: create release
44 command: |
46acf072 45 tag=$(/home/circleci/go/bin/semantics --output-tag)
6988a057 46 if [ "$tag" ]; then
0620da73 47 /home/circleci/go/bin/ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $tag dist/
6988a057
JH
48 else
49 echo "The commit message(s) did not indicate a major/minor/patch version."
50 fi
51
52workflows:
53 version: 2
54 build-deploy:
55 jobs:
56 - build
57 - deploy:
58 requires:
59 - build
60 filters:
61 branches:
62 only: master