Skip to content

Commit

Permalink
Package and auto-release
Browse files Browse the repository at this point in the history
  • Loading branch information
diranged committed Nov 11, 2020
1 parent 78a7afa commit 97a8ae0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: BuildAndRelease

on:
push:
tags: ['v*']

jobs:
build:
name: BuildAndRelease
runs-on: ubuntu-latest
steps:

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

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

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

- name: golint
run: go get -u golang.org/x/lint/golint

- name: Build
run: make build test

- name: Package
run: make release

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: AWS Kinesis Streams for Fluent Bit ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./plugin.tgz
asset_name: plugin-${{ env.RELEASE_VERSION }}.tgz
asset_content_type: application/x-gzip

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ release:
@echo "Built Amazon Kinesis Data Streams Fluent Bit Plugin v$(PLUGIN_VERSION)"

.PHONY: build
build: $(PLUGIN_BINARY) release
build: $(PLUGIN_BINARY) release plugin.tgz

$(PLUGIN_BINARY): $(SOURCES)
PATH=${PATH} golint ./kinesis

plugin.tgz: $(PLUGIN_BINARY)
tar --strip-components 1 -zcvf plugin.tgz $(PLUGIN_BINARY)

.PHONY: generate
generate: $(SOURCES)
go generate ./...
Expand Down

0 comments on commit 97a8ae0

Please sign in to comment.