Skip to content

Commit

Permalink
Remove -s and -w flags from go build
Browse files Browse the repository at this point in the history
  • Loading branch information
mtibben committed Mar 19, 2021
1 parent d1cc5be commit a5745b7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=$(shell git describe --tags --candidates=1 --dirty)
BUILD_FLAGS=-ldflags="-X main.Version=$(VERSION) -s -w" -trimpath
BUILD_FLAGS=-ldflags="-X main.Version=$(VERSION)" -trimpath
CERT_ID ?= Developer ID Application: 99designs Inc (NRM9HVJ62Z)
SRC=$(shell find . -name '*.go') go.mod
INSTALL_DIR ?= ~/bin
Expand All @@ -15,11 +15,12 @@ install: aws-vault
codesign --options runtime --timestamp --sign "$(CERT_ID)" $(INSTALL_DIR)/aws-vault || true

binaries: aws-vault-linux-amd64 aws-vault-linux-arm64 aws-vault-linux-ppc64le aws-vault-linux-arm7 aws-vault-android-arm64 aws-vault-darwin-amd64 aws-vault-darwin-arm64 aws-vault-windows-386.exe aws-vault-freebsd-amd64
dmgs: aws-vault-darwin-amd64.dmg aws-vault-darwin-arm64.dmg

clean:
rm -f ./aws-vault ./aws-vault-*-* ./SHA256SUMS

release: binaries aws-vault-darwin-amd64.dmg aws-vault-darwin-arm64.dmg SHA256SUMS
release: binaries dmgs SHA256SUMS
@echo "\nTo update homebrew-cask run\n\n cask-repair -v $(shell echo $(VERSION) | sed 's/v\(.*\)/\1/') aws-vault\n"

aws-vault-darwin-amd64: $(SRC)
Expand Down Expand Up @@ -55,14 +56,15 @@ aws-vault-darwin-amd64.dmg: aws-vault-darwin-amd64
aws-vault-darwin-arm64.dmg: aws-vault-darwin-arm64
./bin/create-dmg aws-vault-darwin-arm64 $@

SHA256SUMS: binaries aws-vault-darwin-amd64.dmg
SHA256SUMS: binaries dmgs
shasum -a 256 \
aws-vault-freebsd-amd64 \
aws-vault-linux-amd64 \
aws-vault-linux-arm64 \
aws-vault-linux-ppc64le \
aws-vault-linux-arm7 \
aws-vault-android-arm64 \
aws-vault-windows-386.exe \
aws-vault-darwin-amd64.dmg \
aws-vault-darwin-arm64.dmg > $@
aws-vault-android-arm64 \
aws-vault-darwin-amd64.dmg \
aws-vault-darwin-arm64.dmg \
aws-vault-freebsd-amd64 \
aws-vault-linux-amd64 \
aws-vault-linux-arm64 \
aws-vault-linux-arm7 \
aws-vault-linux-ppc64le \
aws-vault-windows-386.exe \
> $@
10 changes: 7 additions & 3 deletions bin/create-dmg
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ APPLE_ID_APP_PASSWORD="${APPLE_ID_APP_PASSWORD:-"@keychain:AC_PASSWORD"}"
CERT_ID="${CERT_ID:-"Developer ID Application: 99designs Inc (NRM9HVJ62Z)"}"
BUNDLE_ID="${BUNDLE_ID:-"com.99designs.aws-vault"}"

tmplog=$(mktemp)
tmpdir="$(mktemp -d)"
trap "rm -rf $tmpdir" EXIT
trap "rm -rf $tmpdir $tmplog" EXIT

cp -a $BIN_PATH $tmpdir/aws-vault
src_path="$tmpdir/aws-vault"
Expand All @@ -38,8 +39,11 @@ echo "Signing dmg"
codesign --timestamp --sign "$CERT_ID" "$DMG_PATH"

echo "Submitting notorization request"
request_uuid=$(xcrun altool --notarize-app --primary-bundle-id "$BUNDLE_ID" --username "$APPLE_ID_USERNAME" --password "$APPLE_ID_APP_PASSWORD" --file $DMG_PATH 2>&1 \
| awk '/RequestUUID/ { print $NF; }')
if ! xcrun altool --notarize-app --primary-bundle-id "$BUNDLE_ID" --username "$APPLE_ID_USERNAME" --password "$APPLE_ID_APP_PASSWORD" --file $DMG_PATH > $tmplog 2>&1 ; then
cat $tmplog
exit 1
fi
request_uuid=$(cat "$tmplog" | awk '/RequestUUID/ { print $NF; }')
echo "Finished submitting, got Request UUID $request_uuid"

echo -n "Waiting for notorization to complete"
Expand Down

0 comments on commit a5745b7

Please sign in to comment.