Skip to content

Commit

Permalink
Merge pull request #298 from kzys/apple-fix
Browse files Browse the repository at this point in the history
Run "make all-variants" only if Go >= 1.16
  • Loading branch information
kzys authored Oct 27, 2021
2 parents 42cd54a + e61bf25 commit f15886b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,14 @@ jobs:
with:
go-version: ${{ matrix.go }}
- run: make get-deps
- run: make all-variants

# Apple Silicon is not supported by Go < 1.16.
# https://go.dev/blog/go1.16
- name: Cross-compile all variants
run: make all-variants
if: ${{ matrix.go >= '1.16' }}
- name: Cross-compile all variants except for Apple Silicon
run: make linux-amd64 linux-arm64 darwin-amd64 windows-amd64
if: ${{ matrix.go < '1.16' }}

- run: make test
4 changes: 3 additions & 1 deletion scripts/build_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

set -euo pipefail

# Normalize to working directory being build root (up one level from ./scripts)
ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )
cd "${ROOT}"
Expand All @@ -32,7 +34,7 @@ if [[ -n "${3}" ]]; then
version_ldflags="$version_ldflags -X ${package_root}/version.GitCommitSHA=${3}"
fi

GOOS=$TARGET_GOOS GOARCH=$TARGET_GOARCH CGO_ENABLED=0 \
GOOS=${TARGET_GOOS:-} GOARCH=${TARGET_GOARCH:-} CGO_ENABLED=0 \
go build -installsuffix cgo -a -ldflags "-s ${version_ldflags}" \
-o ../$1/docker-credential-ecr-login \
./cli/docker-credential-ecr-login
2 changes: 2 additions & 0 deletions scripts/build_variant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

set -euo pipefail

# This script is used for compilation of a specific variant.
# Specify GOOS as $1, GOARCH as $2
# Binaries are placed into ./bin/$GOOS-$GOARCH/docker-credential-ecr-login
Expand Down

0 comments on commit f15886b

Please sign in to comment.