Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 202bd1d

Browse files
authored
Merge pull request #28 from hellofresh/feature/add-goreleaser-config
EES-4740 - adding goreleaser config
2 parents e7d277c + 83e43ef commit 202bd1d

File tree

6 files changed

+36
-65
lines changed

6 files changed

+36
-65
lines changed

.github/workflows/testing.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ jobs:
3131
- name: Run tests
3232
if: success()
3333
run: make test
34+
- name: Upload codecov
35+
uses: codecov/codecov-action@v1
36+
if: success()
37+
with:
38+
file: ./coverage.txt
39+
fail_ci_if_error: false
40+
- name: Test GoReleaser
41+
uses: goreleaser/goreleaser-action@v2
42+
with:
43+
args: release --skip-publish
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
project_name: github-cli
2+
3+
builds:
4+
- id: binary-build
5+
main: main.go
6+
binary: github-cli
7+
ldflags:
8+
- -s -w -X github.com/hellofresh/github-cli/cmd.version=={{.Version}}
9+
env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- darwin
14+
- windows
15+
goarch:
16+
- amd64

Makefile

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,6 @@ OK_COLOR=\033[32;01m
33
ERROR_COLOR=\033[31;01m
44
WARN_COLOR=\033[33;01m
55

6-
# The import path is the unique absolute name of your repository.
7-
# All subpackages should always be imported as relative to it.
8-
# If you change this, run `make clean`.
9-
IMPORT_PATH := github.com/hellofresh/github-cli
10-
PKG_SRC := $(IMPORT_PATH)
11-
12-
GO_PROJECT_PACKAGES=`go list ./... | grep -v /vendor/`
13-
14-
.PHONY: all clean build
15-
16-
all: clean build
17-
18-
# Builds the project
19-
build: install
20-
21-
# Installs our project: copies binaries
22-
install:
23-
@echo "$(OK_COLOR)==> Building... $(NO_COLOR)"
24-
/bin/sh -c "PKG_SRC=$(PKG_SRC) VERSION=${VERSION} ./build/build.sh"
25-
6+
.PHONY: test
267
test:
27-
go test ${GO_PROJECT_PACKAGES} -v
28-
29-
# Cleans our project: deletes binaries
30-
clean:
31-
@echo "$(OK_COLOR)==> Cleaning project$(NO_COLOR)"
32-
go clean
8+
go test -cover ./... -coverprofile=coverage.txt -covermode=atomic

build/build.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

cmd/root.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package cmd
33
import (
44
"context"
55

6+
"github.com/sirupsen/logrus"
7+
"github.com/spf13/cobra"
8+
69
"github.com/hellofresh/github-cli/pkg/config"
710
"github.com/hellofresh/github-cli/pkg/github"
811
"github.com/hellofresh/github-cli/pkg/log"
9-
"github.com/sirupsen/logrus"
10-
"github.com/spf13/cobra"
1112
)
1213

1314
type (

cmd/version.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package cmd
33
import (
44
"context"
55

6-
"github.com/hellofresh/github-cli/pkg/log"
76
"github.com/spf13/cobra"
7+
8+
"github.com/hellofresh/github-cli/pkg/log"
89
)
910

10-
var version = "0.0.15"
11+
var version = "0.0.0-dev"
1112

1213
// NewVersionCmd creates a new version command
1314
func NewVersionCmd(ctx context.Context) *cobra.Command {

0 commit comments

Comments
 (0)