github.com/theQRL/go-zond@v0.1.1/.circleci/config.yml (about) 1 version: 2.1 2 3 filters-release: &filters-release 4 tags: 5 only: 6 - /^v.*/ 7 branches: 8 ignore: /.*/ 9 10 restore_go_cache: &restore_go_cache 11 restore_cache: 12 keys: 13 - go-mod-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }} 14 - go-mod-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }} 15 - go-mod-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-main 16 17 save_go_cache: &save_go_cache 18 save_cache: 19 when: always 20 key: go-mod-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }} 21 paths: 22 - /home/circleci/go/pkg/mod 23 24 commands: 25 prepare-publish-artifacts: 26 parameters: 27 platform: 28 type: string 29 default: "linux-amd64" 30 file_extension: 31 type: string 32 default: "" 33 steps: 34 - run: | 35 cp build/bin/gzond<< parameters.file_extension >> /tmp/gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >> 36 37 (cd /tmp && sha256sum gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >> > gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >>.sha256) 38 39 echo -n "$GPG_KEY" | base64 --decode | gpg --import 40 gpg -o /tmp/gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >>.sig --default-key 28580FDD99DA68203ABCE4205EA04E4E0FAC11B6 --sign --detach-sig /tmp/gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >> 41 42 ./hack/upload-github-release-asset.sh github_api_token=$GITHUB_TOKEN owner=theQRL repo=go-zond tag=${CIRCLE_TAG} filename=/tmp/gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >> 43 ./hack/upload-github-release-asset.sh github_api_token=$GITHUB_TOKEN owner=theQRL repo=go-zond tag=${CIRCLE_TAG} filename=/tmp/gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >>.sha256 44 ./hack/upload-github-release-asset.sh github_api_token=$GITHUB_TOKEN owner=theQRL repo=go-zond tag=${CIRCLE_TAG} filename=/tmp/gzond-${CIRCLE_TAG}-<< parameters.platform >><< parameters.file_extension >>.sig 45 46 jobs: 47 publish-linux-amd64-gzond-binary: 48 docker: 49 - image: cimg/go:1.20 50 steps: 51 - checkout 52 - *restore_go_cache 53 - run: 54 command: go mod download 55 - *save_go_cache 56 - run: | 57 go run build/ci.go install ./cmd/gzond 58 - prepare-publish-artifacts: 59 platform: "linux-amd64" 60 61 publish-linux-arm64-gzond-binary: 62 machine: 63 image: ubuntu-2204:2023.07.1 64 resource_class: arm.medium 65 steps: 66 - checkout 67 - *restore_go_cache 68 - run: 69 command: go mod download 70 - *save_go_cache 71 - run: | 72 go run build/ci.go install ./cmd/gzond 73 - prepare-publish-artifacts: 74 platform: "linux-arm64" 75 76 publish-darwin-amd64-gzond-binary: 77 macos: 78 xcode: 14.2.0 79 resource_class: macos.x86.medium.gen2 80 steps: 81 - checkout 82 - run: | 83 # NOTE(rgeraldes24): currently relying on brew auto update to have the latest 84 # versions of golang available but this can be achieved in other ways! 85 brew install go@1.20 86 echo 'export PATH="/usr/local/opt/go@1.20/bin:$PATH"' >> /Users/distiller/.bash_profile 87 brew install coreutils 88 brew install gpg 89 - *restore_go_cache 90 - run: 91 command: go mod download 92 - *save_go_cache 93 - run: 94 command: go run build/ci.go install ./cmd/gzond 95 - prepare-publish-artifacts: 96 platform: "darwin-amd64" 97 98 workflows: 99 release: 100 jobs: 101 - publish-linux-amd64-gzond-binary: 102 filters: 103 <<: *filters-release 104 - publish-linux-arm64-gzond-binary: 105 filters: 106 <<: *filters-release 107 - publish-darwin-amd64-gzond-binary: 108 filters: 109 <<: *filters-release