Skip to content

Commit

Permalink
Add ci/release with github action (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mouminoux authored May 7, 2022
1 parent 39304f9 commit 8160e2f
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 26 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on: [ push, pull_request ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go

- name: Check out code
uses: actions/checkout@v2

- name: Build & Test
run: make build
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

# Triggered only when a tag is pushed
on:
push:
branches:
- "!*"
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
name: goreleaser
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Release the application
uses: goreleaser/goreleaser-action@v2
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
builds:
- env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -extldflags "-static"
- -X main.version={{.Version}}
goos:
- linux
- darwin
goarch:
- amd64
- arm64
binary: kafkacli

archives:
- replacements:
darwin: Darwin
linux: Linux
amd64: x86_64

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kafkacli [![Build Status](https://travis-ci.org/mouminoux/kafkacli.svg?branch=master)](https://travis-ci.org/mouminoux/kafkacli) [![Go Report Card](https://goreportcard.com/badge/github.com/mouminoux/kafkacli)](https://goreportcard.com/report/github.com/mouminoux/kafkacli)
# Kafkacli

Kafkacli is a consumer and producer client for Apache Kafka.

Expand Down

0 comments on commit 8160e2f

Please sign in to comment.