Skip to content

Commit

Permalink
Remove the last bit of circleci: releases (#206)
Browse files Browse the repository at this point in the history
The intent is to port current behaviour from circleci to actions, to wit: a push of a tag should trigger a release via goreleaser.

Besides changing build platforms, we're also moving to Go 1.17 and the latest goreleaser version.
  • Loading branch information
ncabatoff authored Oct 17, 2021
1 parent c5cc3b0 commit 035e2f7
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 45 deletions.
36 changes: 0 additions & 36 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
- name: setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17.2'
go-version: '1.17'

- uses: actions/checkout@master

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
tags:
- v[0-9].*

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17'

- run: make test

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: "~> 0.182"
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 13 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ builds:
flags: -tags netgo
ldflags:
- -s -w
- -X github.com/prometheus/common/version.Branch={{.Env.BRANCH}}
- -X github.com/prometheus/common/version.BuildDate={{.Date}}
- -X github.com/prometheus/common/version.BuildUser=goreleaser
- -X github.com/prometheus/common/version.Revision={{.FullCommit}}
Expand All @@ -19,6 +18,9 @@ builds:
- arm64
- ppc64
- ppc64le
goarm:
- 6
- 7
archives:
- name_template: "process-exporter-{{ .Version }}.{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: true
Expand All @@ -33,11 +35,16 @@ nfpms:
- deb
- rpm
bindir: /usr/bin
files:
packaging/process-exporter.service: /lib/systemd/system/process-exporter.service
config_files:
packaging/conf/all.yaml: /etc/process-exporter/all.yaml
packaging/default/process-exporter: /etc/default/process-exporter
contents:
- src: packaging/process-exporter.service
dst: /lib/systemd/system/process-exporter.service
src: packaging/conf/all.yaml
dst: /etc/process-exporter/all.yaml
type: config
- src: packaging/default/process-exporter
dst: /etc/default/process-exporter
type: config

scripts:
postinstall: "packaging/scripts/postinstall.sh"
postremove: "packaging/scripts/postremove.sh"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM --platform=$BUILDPLATFORM golang:1.16 AS build
FROM --platform=$BUILDPLATFORM golang:1.17 AS build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
WORKDIR /go/src/github.com/ncabatoff/process-exporter
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Prometheus exporter that mines /proc to report on selected processes.

[![Release](https://img.shields.io/github/release/ncabatoff/process-exporter.svg?style=flat-square")][release]
[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?branch=master)](https://github.com/goreleaser)
[![CircleCI](https://circleci.com/gh/ncabatoff/process-exporter.svg?style=shield)](https://circleci.com/gh/ncabatoff/process-exporter)
![Build](https://github.com/ncabatoff/process-exporter/actions/workflows/build.yml/badge.svg)

Some apps are impractical to instrument directly, either because you
don't control the code or they're written in a language that isn't easy to
instrument with Prometheus. We must instead resort to mining /proc.
Expand Down

0 comments on commit 035e2f7

Please sign in to comment.