Skip to content

Commit

Permalink
Merge pull request #1 from orlade/fixbuild
Browse files Browse the repository at this point in the history
Fix the build
  • Loading branch information
orlade-anz authored Jul 30, 2020
2 parents 176851c + 4ae9c7c commit 1b87df4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 130 deletions.
38 changes: 0 additions & 38 deletions .github/goreleaser_configs/.goreleaser-macOS-latest.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/goreleaser_configs/.goreleaser-ubuntu-latest.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/goreleaser_configs/.goreleaser-windows-latest.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/generate-tag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate-Tag
name: Generate Tag

on:
push:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ jobs:
uses: goreleaser/[email protected]
with:
version: v0.140.0
args: check -f .github/goreleaser_configs/.goreleaser.yml
args: check -f .goreleaser.yml

- name: Set env
run: echo ::set-env name=GOVERSION::$(go version | awk '{print $3, $4;}')

# GoReleaser release process is customized in `.goreleaser.yml` file
- name: Release binaries via goreleaser
uses: goreleaser/[email protected]
with:
version: v0.140.0
args: release --rm-dist --debug -f .github/goreleaser_configs/.goreleaser.yml
args: release --rm-dist --debug -f .goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ before:
- go mod tidy

build:
binary: plantuml-encode
main: plantuml-encode
ldflags:
- -s -w -X main.Version=v{{.Version}}
- -X main.GitCommit={{.ShortCommit}}
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.PHONY: all tidy lint build test releasebuild docker docker.run

VERSION=`cat VERSION`
GO_VERSION=$(strip $(subst go version, , $(shell go version)))
GO_VERSION=$(shell go version | cut -d' ' -f3)

LDFLAGS='-X "main.Version=$(VERSION)" -X "main.GoVersion=$(GO_VERSION)"'

Expand All @@ -11,23 +13,21 @@ tidy:
goimports -w .
gofmt -w .

.PHONY: lint
lint:
golangci-lint run ./...

.PHONY: build
build: main.go
go build -v -o ./dist/plantuml-encode -ldflags=$(LDFLAGS) main.go

.PHONY: test
test: main.go main_test.go
go test ./...
go test -v -race ./...

releasebuild: main.go
GOVERSION=$(GOVERSION) goreleaser build --rm-dist --snapshot

.PHONY: docker
docker: main.go
docker build -t orlade/plantuml-encode .

# Pipe input to this target to encode it.
.PHONY: docker.run
docker.run:
docker run -i --rm orlade/plantuml-encode

0 comments on commit 1b87df4

Please sign in to comment.