Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to github actions for build and release pipeline #39

Merged
merged 6 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.