Skip to content

Commit a2e5d19

Browse files
Merge pull request #4 from codeperfio/publish.fix
Setting up hombrew tap
2 parents f132367 + 2a331f4 commit a2e5d19

File tree

7 files changed

+73
-37
lines changed

7 files changed

+73
-37
lines changed

.github/workflows/publish.yaml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
name: publish
1+
name: goreleaser
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
610

711
jobs:
8-
publish:
9-
strategy:
10-
matrix:
11-
go-version: [ 1.15.x ]
12-
os: [ ubuntu-latest ]
13-
runs-on: ${{ matrix.os }}
12+
goreleaser:
13+
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@master
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v2
1618
with:
17-
fetch-depth: 1
18-
- name: Install Go
19+
fetch-depth: 0
20+
-
21+
name: Set up Go
1922
uses: actions/setup-go@v2
2023
with:
21-
go-version: ${{ matrix.go-version }}
22-
- name: Make all
23-
run: make all
24-
- name: Upload release binaries
25-
uses: alexellis/[email protected]
26-
env:
27-
GITHUB_TOKEN: ${{ github.token }}
24+
go-version: 1.17
25+
-
26+
name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v2
2828
with:
29-
asset_paths: '["./bin/pprof-exporter*"]'
29+
distribution: goreleaser
30+
version: ${{ env.GITHUB_REF_NAME }}
31+
args: release --rm-dist
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.dylib
77
bin
88
pprof-exporter*
9+
codeperf*
910

1011
# Test binary, built with `go test -c`
1112
*.test

.goreleaser

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
builds:
2+
- binary: codeperf
3+
goos:
4+
- darwin
5+
- linux
6+
goarch:
7+
- amd64
8+
- arm64
9+
env:
10+
- CGO_ENABLED=0
11+
flags:
12+
- -mod=vendor
13+
14+
release:
15+
prerelease: auto
16+
17+
universal_binaries:
18+
- replace: true
19+
20+
brews:
21+
-
22+
name: codeperf
23+
homepage: "https://github.com/codeperfio/codeperf"
24+
tap:
25+
owner: codeperf
26+
name: homebrew-codeperf
27+
commit_author:
28+
name: codeperf.io
29+
30+
31+
checksum:
32+
name_template: 'checksums.txt'

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ifeq ($(GIT_VERSION),)
1010
GIT_VERSION:=$(shell git describe --tags --dirty)
1111
endif
1212

13-
LDFLAGS := "-s -w -X github.com/codeperfio/pprof-exporter/cmd.Version=$(GIT_VERSION) -X github.com/codeperfio/pprof-exporter/cmd.GitCommit=$(GIT_COMMIT)"
13+
LDFLAGS := "-s -w -X github.com/codeperfio/codeperf/cmd.Version=$(GIT_VERSION) -X github.com/codeperfio/codeperf/cmd.GitCommit=$(GIT_COMMIT)"
1414
export GO111MODULE=on
1515
SOURCE_DIRS = cmd main.go
1616

@@ -38,12 +38,11 @@ lint:
3838
.PHONY: dist
3939
dist:
4040
mkdir -p bin/
41-
rm -rf bin/pprof-exporter*
42-
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/pprof-exporter
43-
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/pprof-exporter-darwin
44-
GOARM=6 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/pprof-exporter-armhf
45-
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/pprof-exporter-arm64
46-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/pprof-exporter.exe
41+
rm -rf bin/codeperf*
42+
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/codeperf
43+
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/codeperf-darwin
44+
GOARM=6 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/codeperf-armhf
45+
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/codeperf-arm64
4746

4847
.PHONY: hash
4948
hash:

cmd/root.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
2+
Copyright © 2022 codeperf.io <[email protected]>
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -43,12 +43,12 @@ var longDescription = ` __ ____ _
4343
\___/\____/\__,_/\___/ .___/\___/_/ /_/ (_) /_/\____/
4444
/_/
4545
46-
Export and persist Go's profiling data locally, or into https://codeperf.io for FREE.`
46+
Export and persist Go's profiling data locally, or into https://codeperf.io.`
4747

4848
// rootCmd represents the base command when called without any subcommands
4949
var rootCmd = &cobra.Command{
5050
Use: "pprof-exporter",
51-
Short: "Export and persist Go's profiling data locally, or into https://codeperf.io for FREE.",
51+
Short: "Export and persist Go's profiling data locally, or into https://codeperf.io.",
5252
Long: longDescription,
5353
Run: exportLogic(),
5454
}
@@ -85,7 +85,7 @@ func init() {
8585
// Cobra supports persistent flags, which, if defined here,
8686
// will be global for your application.
8787

88-
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.pprof-exporter.yaml)")
88+
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.codeperf.yaml)")
8989
rootCmd.PersistentFlags().BoolVar(&local, "local", false, "don't push the data to https://codeperf.io")
9090
rootCmd.PersistentFlags().StringVar(&bench, "bench", "", "Benchmark name")
9191
rootCmd.PersistentFlags().StringVar(&gitOrg, "git-org", defaultGitOrg, "git org")
@@ -130,10 +130,10 @@ func initConfig() {
130130
home, err := os.UserHomeDir()
131131
cobra.CheckErr(err)
132132

133-
// Search config in home directory with name ".pprof-exporter" (without extension).
133+
// Search config in home directory with name ".codeperf" (without extension).
134134
viper.AddConfigPath(home)
135135
viper.SetConfigType("yaml")
136-
viper.SetConfigName(".pprof-exporter")
136+
viper.SetConfigName(".codeperf")
137137
}
138138

139139
viper.AutomaticEnv() // read in environment variables that match

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/codeperfio/pprof-exporter
1+
module github.com/codeperfio/codeperf
22

33
go 1.16
44

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616
package main
1717

18-
import "github.com/codeperfio/pprof-exporter/cmd"
18+
import "github.com/codeperfio/codeperf/cmd"
1919

2020
func main() {
2121
cmd.Execute()

0 commit comments

Comments
 (0)