-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Build Files To Generate Releases
- Loading branch information
Showing
3 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: cimg/go:1.21 | ||
steps: | ||
- checkout | ||
- run: go install github.com/tcnksm/ghr@v0.16.0 | ||
- run: sudo apt-get update && sudo apt-get install p7zip-full | ||
- restore_cache: # restores saved cache if no changes are detected since last run | ||
keys: | ||
- go-mod-v4-{{ checksum "go.sum" }} | ||
- run: make dist | ||
- save_cache: | ||
key: go-mod-v4-{{ checksum "go.sum" }} | ||
paths: | ||
- "/go/pkg/mod" | ||
- run: | ||
name: create release | ||
command: | | ||
if [ "$CIRCLE_TAG" ]; then | ||
mkdir -p dist | ||
mv osactivate*.zip dist | ||
ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $CIRCLE_TAG dist/ | ||
else | ||
echo "No tag" | ||
fi | ||
workflows: | ||
version: 2 | ||
build-workflow: # the name of our workflow | ||
jobs: # the jobs that we are sequencing. | ||
- build: | ||
filters: | ||
tags: | ||
only: /^v.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
EXECUTABLE=osactivate | ||
WINDOWS=$(EXECUTABLE)_windows_amd64.exe | ||
LINUX=$(EXECUTABLE)_linux_amd64 | ||
OSX_AMD64=$(EXECUTABLE)_osx_amd64 | ||
OSX_ARM64=$(EXECUTABLE)_osx_arm64 | ||
ALL=$(WINDOWS) $(LINUX) $(OSX_AMD64) $(OSX_ARM64) | ||
|
||
default: | ||
go build ${LDFLAGS} | ||
|
||
install: | ||
go install ${LDFLAGS} | ||
|
||
$(WINDOWS): | ||
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -v -o $(WINDOWS) ${LDFLAGS} | ||
|
||
$(LINUX): | ||
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o $(LINUX) ${LDFLAGS} | ||
|
||
$(OSX_AMD64): | ||
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -o $(OSX_AMD64) ${LDFLAGS} | ||
|
||
$(OSX_ARM64): | ||
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -o $(OSX_ARM64) ${LDFLAGS} | ||
|
||
$(basename $(WINDOWS)).zip: $(WINDOWS) | ||
zip $@ $< | ||
7za rn $@ $< $(EXECUTABLE)$(suffix $<) | ||
|
||
%.zip: % | ||
zip $@ $< | ||
7za rn $@ $< $(EXECUTABLE) | ||
|
||
dist: test $(addsuffix .zip,$(basename $(ALL))) | ||
|
||
fmt: | ||
go fmt ./... | ||
|
||
test: | ||
test -z "$(go fmt)" | ||
go vet | ||
go test ./... | ||
go test -race ./... | ||
|
||
clean: | ||
-rm -f $(EXECUTABLE) $(EXECUTABLE)_* | ||
|
||
.PHONY: default dist clean docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters