Skip to content

Commit d9e6d16

Browse files
committed
fix: add proper release of binaries
1 parent 218a309 commit d9e6d16

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

Makefile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
OWNER := dnitsch
22
NAME := aws-cli-auth
3-
VERSION := v0.7.4
3+
VERSION := v0.7.7
44
REVISION := $(shell git rev-parse --short HEAD)
55

6-
76
LDFLAGS := -ldflags="-s -w -X \"github.com/dnitsch/aws-cli-auth/cmd.Version=$(VERSION)\" -X \"github.com/dnitsch/aws-cli-auth/cmd.Revision=$(REVISION)\" -extldflags -static"
87

98
.PHONY: test test_ci tidy install buildprep build buildmac buildwin
@@ -40,21 +39,23 @@ cross-build:
4039
GOOS=$$os CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo $(LDFLAGS) -o dist/$(NAME)-$$os$$EXT .; \
4140
done
4241

43-
release: cross-build
42+
# cross-build
43+
release:
4444
git tag $(VERSION)
4545
git push origin $(VERSION)
46-
id=$(shell curl \
47-
-X POST \
48-
-u $(OWNER):$(PAT) \
49-
-H "Accept: application/vnd.github.v3+json" \
50-
https://api.github.com/repos/$(OWNER)/$(NAME)/releases \
51-
-d '{"tag_name":"$(VERSION)","generate_release_notes":true,"prerelease":false}' | jq -r .id) \
52-
upload_url=https://uploads.github.com/repos/$(OWNER)/$(NAME)/releases/$$id/assets; \
53-
for asset in dist/*; do \
54-
echo $$asset; \
55-
name=$(shell echo $$asset | cut -c 6-); \
56-
curl -u $(OWNER):$(PAT) -H "Content-Type: application/x-binary" -X POST --data-binary "@$$asset" "$$upload_url?name=$$name"; \
57-
done
46+
OWNER=$(OWNER) NAME=$(NAME) PAT=$(PAT) VERSION=$(VERSION) . hack/release.sh
47+
# id=$(shell curl \
48+
# -X POST \
49+
# -u $(OWNER):$(PAT) \
50+
# -H "Accept: application/vnd.github.v3+json" \
51+
# https://api.github.com/repos/$(OWNER)/$(NAME)/releases \
52+
# -d '{"tag_name":"$(VERSION)","generate_release_notes":true,"prerelease":false}' | jq -r .id) \
53+
# upload_url=https://uploads.github.com/repos/$(OWNER)/$(NAME)/releases/$$id/assets; \
54+
# for asset in dist/*; do \
55+
# echo $$asset; \
56+
# name=$(shell echo $asset | cut -c 6-); \
57+
# curl -u $(OWNER):$(PAT) -H "Content-Type: application/x-binary" -X POST --data-binary "@$$asset" "$$upload_url?name=$$name"; \
58+
# done
5859

5960
.PHONY: deps
6061
deps:

hack/release.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
id=$(curl -X POST -u $OWNER:$PAT -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/$OWNER/$NAME/releases -d "{\"tag_name\":\"$VERSION\",\"generate_release_notes\":true,\"prerelease\":false}" | jq -r .id)
4+
5+
upload_url=https://uploads.github.com/repos/$OWNER/$NAME/releases/$id/assets
6+
7+
for asset in dist/*; do \
8+
name=$(echo $asset | cut -c 6-)
9+
curl -u $OWNER:$PAT -H "Content-Type: application/x-binary" -X POST --data-binary "@$asset" "$upload_url?name=$name"
10+
done

0 commit comments

Comments
 (0)