Skip to content

Commit

Permalink
remove gator windows (#1658)
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <[email protected]>
  • Loading branch information
sozercan authored Nov 11, 2021
1 parent 35b2113 commit c2119e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,21 +309,14 @@ jobs:
build() {
export GOOS="$(echo ${1} | cut -d '-' -f 1)"
export GOARCH="$(echo ${1} | cut -d '-' -f 2)"
# in case of windows, we need to append .exe to the file name
EXTENSION="$(echo ${1} | cut -d '-' -f 3)"
EXTENSION=${EXTENSION/exe/.exe}
FILENAME=${GITHUB_WORKSPACE}/_dist/gator-${TAG}-${GOOS}-${GOARCH}
# build the binary
make bin/gator-${GOOS}-${GOARCH}${EXTENSION}
make bin/gator-${GOOS}-${GOARCH}
# rename the binary to gator
tmp_dir=$(mktemp -d)
cp bin/gator-${GOOS}-${GOARCH}${EXTENSION} ${tmp_dir}/gator${EXTENSION}
cp bin/gator-${GOOS}-${GOARCH} ${tmp_dir}/gator
pushd ${tmp_dir}
if [[ ${EXTENSION} == ".exe" ]]; then
zip ${FILENAME}.zip gator*.exe
else
tar -czf ${FILENAME}.tar.gz gator*
fi
tar -czf ${FILENAME}.tar.gz gator*
popd
}
mkdir -p _dist
Expand All @@ -332,11 +325,11 @@ jobs:
done
wait
pushd _dist
# consolidate tar and zip's sha256sum into a single file
find . -type f -name '*.tar.gz' -o -name '*.zip' | sort | xargs sha256sum >> sha256sums.txt
# consolidate tar's sha256sum into a single file
find . -type f -name '*.tar.gz' | sort | xargs sha256sum >> sha256sums.txt
popd
env:
PLATFORMS: "linux-amd64 linux-arm64 darwin-amd64 darwin-arm64 windows-amd64-exe"
PLATFORMS: "linux-amd64 linux-arm64 darwin-amd64 darwin-arm64"

- name: Create GitHub release
uses: "marvinpinto/[email protected]"
Expand All @@ -346,7 +339,6 @@ jobs:
files: |
_dist/sha256sums.txt
_dist/*.tar.gz
_dist/*.zip
- name: Publish Helm chart
uses: stefanprodan/[email protected]
Expand Down
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,8 @@ vendor:
go mod tidy

.PHONY: gator
gator: bin/gator-$(GOOS)-$(GOARCH)$(EXTENSION)
mv bin/gator-$(GOOS)-$(GOARCH)$(EXTENSION) bin/gator
gator: bin/gator-$(GOOS)-$(GOARCH)
mv bin/gator-$(GOOS)-$(GOARCH) bin/gator

EXTENSION.linux :=
EXTENSION.darwin :=
EXTENSION.windows := .exe
EXTENSION := $(EXTENSION.$(GOOS))

bin/gator-$(GOOS)-$(GOARCH)$(EXTENSION):
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BIN_DIR)/gator-$(GOOS)-$(GOARCH)$(EXTENSION) -ldflags $(LDFLAGS) ./cmd/gator
bin/gator-$(GOOS)-$(GOARCH):
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BIN_DIR)/gator-$(GOOS)-$(GOARCH) -ldflags $(LDFLAGS) ./cmd/gator

0 comments on commit c2119e8

Please sign in to comment.