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

feat: release action #7

Merged
merged 1 commit into from
May 20, 2022
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
44 changes: 44 additions & 0 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
project_name: kvrocks-exporter
release:
github:
owner: KvrocksLabs
name: kvrocks_exporter

builds:
- id: kvrocks-exporter
binary: kvrocks_exporter
ldflags:
- "-X main.BuildVersion={{ .Version }}"
- "-X main.BuildDate={{.Date}}"
- "-X main.BuildCommitSha={{.Commit}}"
goos:
- linux
goarch:
- amd64
- arm64
dockers:
- id: kvrocks-exporter-docker-amd64
goos: linux
goarch: amd64
ids:
- kvrocks-exporter
image_templates:
- "kvrocks/kvrocks-exporter:v{{ .Version }}-amd64"
build_flag_templates:
- "--platform=linux/amd64"
use: buildx
- id: kvrocks-exporter-docker-arm64
goos: linux
goarch: arm64
ids:
- kvrocks-exporter
image_templates:
- "kvrocks/kvrocks-exporter:v{{ .Version }}-arm64"
build_flag_templates:
- "--platform=linux/arm64"
use: buildx
docker_manifests:
- name_template: kvrocks/kvrocks-exporter:v{{ .Version }}
image_templates:
- kvrocks/kvrocks-exporter:v{{ .Version }}-amd64
- kvrocks/kvrocks-exporter:v{{ .Version }}-arm64
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
tags:
- "*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Release kvrocks-exporter
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist -f ./.github/goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine
COPY /kvrocks_exporter /kvrocks_exporter

EXPOSE 9121

ENTRYPOINT [ "/kvrocks_exporter" ]