Skip to content

Commit

Permalink
Merge to main (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanericky authored Mar 24, 2023
1 parent d81cf99 commit 9a75d16
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.20.x
-
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ coverage.*
settings.json
testcollection.json
totp
!cmd/totp/
.idea/
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ before:
hooks:
- go mod tidy
builds:
- main: ./cmd
- main: ./cmd/totp
binary: totp
ldflags:
- -s -w -X github.com/arcanericky/totp/commands.versionText={{.Version}}
Expand Down
24 changes: 6 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION=1.0.0-incubation
VERSION_INJECT=github.com/arcanericky/totp/cmd.versionText
SRCS=*.go cmd/*.go commands/*.go
SRCS=*.go cmd/**/*.go commands/*.go
MAIN=./cmd/...
EXECUTABLE=bin/totp

Expand Down Expand Up @@ -37,23 +37,11 @@ test:
go test -race -coverprofile=coverage.txt -covermode=atomic . ./commands
go tool cover -html=coverage.txt -o coverage.html

$(WINDOWS_AMD64): $(SRCS)
GOOS=windows GOARCH=amd64 go build -o $@ -ldflags "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)" $(MAIN)

$(LINUX_AMD64): $(SRCS)
GOOS=linux GOARCH=amd64 go build -o $@ -ldflags "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)" $(MAIN)

$(DARWIN_AMD64): $(SRCS)
GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)" $(MAIN)

$(DARWIN_ARM64): $(SRCS)
GOOS=darwin GOARCH=arm64 go build -o $@ -ldflags "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)" $(MAIN)

$(LINUX_ARM32): $(SRCS)
GOOS=linux GOARCH=arm go build -o $@ -ldflags "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)" $(MAIN)

$(LINUX_ARM64): $(SRCS)
GOOS=linux GOARCH=arm64 go build -o $@ -ldflags "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)" $(MAIN)
$(LINUX_AMD64) $(DARWIN_AMD64) $(DARWIN_ARM64) $(LINUX_ARM32) $(LINUX_ARM64) $(WINDOWS_AMD64): $(SRCS)
$(eval GOOS := $(shell echo $@ | awk -F - '{print $$2}'))
$(eval GOARCH := $(shell echo $@ | awk -F - '{print $$3}' | sed 's/.exe//'))
$(eval LDFLAGS := "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)")
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ -ldflags $(LDFLAGS) $(MAIN)

clean:
rm -rf bin
File renamed without changes.

0 comments on commit 9a75d16

Please sign in to comment.