Skip to content
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
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: goreleaser

on:
push:
# run when new tag is pushed
tags:
- v*
# manually trigger the release
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: percona-platform/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: percona-platform/setup-go@v2
with:
go-version: 1.16
-
name: Run GoReleaser
uses: percona-platform/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
dist: build
builds:
- binary: rds_exporter
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- 7
ignore:
- goos: darwin
goarch: arm
flags:
- -v
ldflags:
- -s -w -X main.version=v{{.Version}} -X main.commit={{.ShortCommit}} -X main.buildDate={{.Date}}
archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Os }}-{{ .Arch }}"
wrap_in_directory: true
snapshot:
name_template: "{{ .ShortCommit }}"
changelog:
skip: true
release:
github:
owner: percona
name: rds_exporter
draft: true
prerelease: auto
dockers:
- goos: linux
goarch: amd64
image_templates:
- "ghcr.io/maxknee/rds_exporter:{{.Major}}.{{.Minor}}"
- "ghcr.io/maxknee/rds_exporter:{{.Version}}"
dockerfile: Dockerfile.releaser
use: buildx
11 changes: 11 additions & 0 deletions Dockerfile.releaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine:latest

COPY ./rds_exporter/rds_exporter /bin/

RUN apk update && \
apk add ca-certificates --no-cache && \
update-ca-certificates && \
rm -f /var/cache/apk/*

EXPOSE 9042
ENTRYPOINT [ "/bin/rds_exporter", "--config.file=/etc/rds_exporter/config.yml" ]