Skip to content

♻️ CircleCI Orbs for Continous-Delivery for Tools

License

Notifications You must be signed in to change notification settings

izumin5210/orbs-for-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orbs-for-tools

CircleCI license

♻️ CircleCI Orbs for Continous-Delivery for Tools

name description version
go-crossbuild Build Go applications for multiplatform and packaging with goxz CircleCI Orb Version
github-release Create a new release on GitHub with ghr CircleCI Orb Version
homebrew Create a Formula for Homebrew with maltmill and commit it to tap repository CircleCI Orb Version
inline Describe commands on workflows directly, like inline-steps CircleCI Orb Version
protobuf Install protobuf (protoc command and standard libs) CircleCI Orb Version
version: 2.1

orbs:
  go-module: timakin/[email protected]
  go-crossbuild: izumin5210/[email protected]
  github-release: izumin5210/[email protected]
  homebrew: izumin5210/[email protected]
  inline: izumin5210/[email protected]

aliases:
  filter-default: &filter-default
    filters:
      tags:
        only: /.*/
  filter-release: &filter-release
    filters:
      branches:
        ignore: /.*/
      tags:
        only: /^v\d+\.\d+\.\d+$/

executors:
  default:
    docker:
      - image: circleci/golang:1.12
    environment:
      - GO111MODULE: "on"

workflows:
  build:
    jobs:
      # Download and cache dependencies
      # https://circleci.com/orbs/registry/orb/timakin/go-module
      - go-module/download:
          <<: *filter-default
          executor: default
          persist-to-workspace: true
          vendoring: true

      # Describe "run tests" steps to a workflow directly
      # https://circleci.com/orbs/registry/orb/izumin5210/inline
      - inline/steps:
          executor: default
          name: test
          steps:
            - run: go test -race -v ./...
          requires:
            - go-module/download

      # Build a Go application for clossplatform
      # https://circleci.com/orbs/registry/orb/izumin5210/go-crossbuild
      - go-crossbuild/build:
          <<: *filter-default
          executor: default
          packages: ./cmd/awesomecli
          requires:
            - go-module/download

      # Create a new release to GitHub Releases
      # https://circleci.com/orbs/registry/orb/izumin5210/github-release
      - github-release/create:
          <<: *filter-release
          # This context contains following env vars:
          # * HOMEBREW_TAP_REPO_SLUG
          # * GITHUB_TOKEN
          # * GITHUB_EMAIL
          # * GITHUB_USER
          executor: default
          context: tool-releasing
          requires:
            - go-crossbuild/build

      # Create (or update) a Homebrew formula
      # https://circleci.com/orbs/registry/orb/izumin5210/homebrew
      - homebrew/update:
          <<: *filter-release
          executor: default
          context: tool-releasing
          requires:
            - github-release/create

Build Go applications for multiplatform and packaging with goxz

Example
workflows:
  build:
    jobs:
      # you should download dependencies
      - setup

      - go-crossbuild/build:
          executor: default
          packages: ./cmd/awesomecli
          workspace-root: /go/src/github.com/example/awesomecli
          requires:
            - setup

Create a new release on GitHub with ghr

Example
aliases:
  filter-release: &filter-release
    filters:
      branches:
        ignore: /.*/
      tags:
        only: /^v\d+\.\d+\.\d+$/

workflows:
  build:
    jobs:
      # you should put built binaries into <path> of github-release/create
      # default: ./artifacts/
      - build

      - github-release/create:
          <<: *filter-release
          # This context contains following env vars:
          # * GITHUB_TOKEN
          context: tool-releasing
          requires:
            - go-crossbuild/build

Create a Formula for Homebrew with maltmill and commit it to tap repository

Example
aliases:
  filter-release: &filter-release
    filters:
      branches:
        ignore: /.*/
      tags:
        only: /^v\d+\.\d+\.\d+$/

workflows:
  build:
    jobs:
      - homebrew/update:
          <<: *filter-release
          # This context contains following env vars:
          # * HOMEBREW_TAP_REPO_SLUG
          # * GITHUB_TOKEN
          # * GITHUB_EMAIL
          # * GITHUB_USER
          context: tool-releasing
          requires:
            - github-release/create

Describe commands on workflows directly, like inline-steps

Example
version: 2.1

orbs:
  go-module: timakin/[email protected]
  inline: izumin5210/[email protected]

executors:
  golang:
    parameters:
      version:
        type: string
    docker:
      - image: circleci/golang:<< parameters.version >>
    environment:
      - GO111MODULE: "on"

aliases:
  go1.11: &go-1-11
    executor:
      name: golang
      version: '1.11'
  go1.12: &go-1-12
    executor:
      name: golang
      version: '1.12'

workflows:
  test:
    jobs:
      - go-module/download:
          <<: *go-1-12
          name: 'setup-1.12'
          persist-to-workspace: true
          vendoring: true

      - go-module/download:
          <<: *go-1-11
          name: 'setup-1.11'
          persist-to-workspace: true
          vendoring: true

      - inline/steps:
          <<: *go-1-12
          name: 'test-1.12'
          steps:
            - run: make cover
            - run: bash <(curl -s https://codecov.io/bash)
          requires:
            - setup-1.12

      - inline/steps:
          <<: *go-1-11
          name: 'test-1.11'
          steps:
            - run: make test
          requires:
            - setup-1.11

      - inline/steps:
          <<: *go-1-12
          name: 'test-e2e-1.12'
          steps:
            - run: make test-e2e
          requires:
            - setup-1.12

      - inline/steps:
          <<: *go-1-11
          name: 'test-e2e-1.11'
          steps:
            - run: make test-e2e
          requires:
            - setup-1.11

Install protobuf (protoc command and standard libs)

Example
version: 2.1

orbs:
  protobuf: izumin5210/[email protected]

jobs:
  protoc:
    docker:
      - image: circleci/golang
    steps:
      - run: protoc --version

workflows:
  build:
    jobs:
      - protobuf/install

      - protoc