Skip to content

Commit

Permalink
Merge pull request apptio#39 from jess-belliveau/master
Browse files Browse the repository at this point in the history
Move to github actions for build and release pipeline
  • Loading branch information
Jess Belliveau authored Oct 25, 2021
2 parents 78278a5 + a15856d commit ebd7903
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 48 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build

on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
-
name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
43 changes: 20 additions & 23 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ before:
hooks:
- go mod download
builds:
-
env:
- CGO_ENABLED=0
- env: [CGO_ENABLED=0]
goos:
- linux
- darwin
- linux
- darwin
goarch:
- amd64
- amd64
main: .
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
binary: kr8
Expand All @@ -28,36 +26,35 @@ archives:
- changelog*
- CHANGELOG*
- scripts/*
nfpms:
-
vendor: Apptio TechOps
homepage: "https://github.com/apptio/kr8"
description: "Opinionated configuration management tool for Kubernetes Cluster"
license: MIT
formats:
- rpm
- deb
bindir: /usr/local/bin
files:
"scripts/kr8-helpers": "/usr/local/bin/kr8-helpers"
snapshot:
name_template: SNAPSHOT-{{ .Commit }}
dist: dist
dockers:
-
image_templates:
- 'apptio/kr8:{{ .Tag }}'
- 'apptio/kr8:latest'
- 'ghcr.io/apptio/kr8:{{ .Tag }}'
- 'ghcr.io/apptio/kr8:latest'
dockerfile: Dockerfile-goreleaser
build_flag_templates:
- "--label=org.label-schema.schema-version=1.0"
- "--label=org.label-schema.version={{.Version}}"
- "--label=org.label-schema.name={{.ProjectName}}"
nfpms:
-
vendor: Apptio TechOps
homepage: "https://github.com/apptio/kr8"
description: "Opinionated configuration management tool for Kubernetes Cluster"
license: MIT
formats:
- rpm
- deb
bindir: /usr/local/bin
brews:
-
github:
owner: apptio
name: homebrew-tap
tap:
owner: jess-belliveau
name: tap-test
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"

commit_author:
name: release
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

0 comments on commit ebd7903

Please sign in to comment.