Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kokoro v3 #9641

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/compile-mac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Cross-Compile skaffold on MacOS

# Triggers the workflow on push or pull request events
on: [push, pull_request]

permissions: read-all

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}-${{github.workflow}}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:

build:
name: Cross-Compile skaffold on MacOS
runs-on: macos-latest
strategy:
matrix:
platforms: [linux-amd64 darwin-amd64 windows-amd64.exe linux-arm64 darwin-arm64]
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.3
id: go

# Retrieve build locations with `go env`
# <https://markphelps.me/posts/speed-up-your-go-builds-with-actions-cache/>
- id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: |
${{ steps.go-cache-paths.outputs.go-build }}
${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Make and install Skaffold binary from current PR
run: |
# Check golang version
echo "Found golang version $(go version) from path $(which go)"
make ./out/VERSION
make ./out/skaffold-${{ matrix.platforms }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ endif

# when build for local development (`LOCAL=true make install` can skip license check)
$(BUILD_DIR)/$(PROJECT): $(EMBEDDED_FILES_CHECK) $(GO_FILES) $(BUILD_DIR)
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,-extldflags \"%\",$(LDFLAGS_$(GOOS))))
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,-extldflags "%",$(LDFLAGS_$(GOOS))))
$(eval tags = $(GO_BUILD_TAGS) $(GO_BUILD_TAGS_$(GOOS)) $(GO_BUILD_TAGS_$(GOOS)_$(GOARCH)))
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=1 \
go build -mod="vendor" -gcflags="all=-N -l" -tags "$(tags)" -ldflags "$(ldflags)" -o $@ $(BUILD_PACKAGE)
go build -mod="vendor" -gcflags="all=-N -l" -tags "$(tags)" -ldflags '$(ldflags)' -o $@ $(BUILD_PACKAGE)
ifeq ($(GOOS),darwin)
codesign --force --deep --sign - $@
endif
Expand Down
Loading