Set CGO_ENABLED=0 for static link (#198)

This commit is contained in:
Hidetake Iwata
2019-12-23 17:55:43 +09:00
committed by GitHub
parent b5ae469b41
commit af18e734ea
2 changed files with 7 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ jobs:
docker:
- image: circleci/golang:1.13.3
steps:
- run: |
sudo apt install -y file
- run: |
mkdir -p ~/bin
echo 'export PATH="$HOME/bin:$PATH"' >> $BASH_ENV
@@ -22,6 +24,10 @@ jobs:
- run: bash <(curl -s https://codecov.io/bash)
- run: make run
- run: make dist
- run: |
unzip dist/gh/kubelogin_linux_amd64.zip -d /tmp
file /tmp/kubelogin
/tmp/kubelogin --help
- run: |
if [ "$CIRCLE_TAG" ]; then
make release

View File

@@ -22,7 +22,7 @@ run: $(TARGET_PLUGIN)
dist:
# make the zip files for GitHub Releases
VERSION=$(CIRCLE_TAG) goxzst -d dist/gh/ -i "LICENSE" -o "$(TARGET)" -t "kubelogin.rb oidc-login.yaml" -- -ldflags "$(LDFLAGS)"
VERSION=$(CIRCLE_TAG) CGO_ENABLED=0 goxzst -d dist/gh/ -i "LICENSE" -o "$(TARGET)" -t "kubelogin.rb oidc-login.yaml" -- -ldflags "$(LDFLAGS)"
zipinfo dist/gh/kubelogin_linux_amd64.zip
# make the Homebrew formula
mv dist/gh/kubelogin.rb dist/