Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverisaac committed Jan 31, 2022
0 parents commit 1c742db
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# from https://dev.to/koddr/github-action-for-release-your-go-projects-as-fast-and-easily-as-possible-20a2
name: Release koi

on:
push:
tags:
- "*" # triggers only if push new tag version, like `0.8.4` or else

jobs:
build:
name: GoReleaser build
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0 # Set fetch-depth: 0 to fetch all history for all branches and tags

- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

dist/
49 changes: 49 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
- go test ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
- arm64
main: main.go
binary: koi

archives:
- replacements:
amd64: x86_64
files:
- README.md

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

# From: https://medium.com/@ben.lafferty/deploying-go-cli-applications-316e9cca16a4
brews:
- tap:
owner: oliverisaac
name: homebrew-tap
folder: Formula
homepage: https://github.com/oliverisaac/koi
description: Kubectl wrapper command

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- 'README'
- Merge pull request
- Merge branch
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

release:
[[ $$( git rev-parse --abbrev-ref HEAD ) == "main" ]] # make sure we are on main
git push origin main
git tag $$( git tag | grep "^v" | sort --version-sort | tail -n 1 | awk -F. '{OFS="."; $$3 = $$3 + 1; print}' )
git push --tags

goreleaser:
goreleaser --snapshot --skip-publish --rm-dist
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# koi

Koi is a wrapper around kubectl that provides additional features:

## -x shorthand flag for --context
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/oliverisaac/koi

go 1.17
Empty file added go.sum
Empty file.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"fmt"
)

func main() {
fmt.Println("hello world")
}

0 comments on commit 1c742db

Please sign in to comment.