Skip to content

Commit 45e55ce

Browse files
authored
Remove CGO build flag (#698)
1 parent 73bc0ac commit 45e55ce

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
- release-**
8-
pull_request_target:
8+
pull_request:
99
types: [ opened, reopened, synchronize ]
1010
workflow_dispatch:
1111

@@ -22,13 +22,14 @@ jobs:
2222
steps:
2323
# Labels PRs based on branch, title, files, and body patterns
2424
- uses: release-drafter/release-drafter/autolabeler@v7
25-
if: github.event_name == 'pull_request_target'
25+
if: github.event_name == 'pull_request'
2626
with:
2727
config-name: release-drafter.yml
2828
token: ${{ secrets.GITHUB_TOKEN }}
2929
# Drafts your next Release notes as Pull Requests are merged into "main"
3030
# or a release branch
3131
- uses: release-drafter/release-drafter@v7
32+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3233
with:
3334
config-name: release-drafter.yml
3435
token: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3939

4040
RUN --mount=type=cache,target=/root/.cache/go-build \
4141
--mount=type=cache,target=/go/pkg \
42-
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags="${LDFLAGS}" -a -o libvirt-provider ./cmd/libvirt-provider/main.go
42+
GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags="${LDFLAGS}" -a -o libvirt-provider ./cmd/libvirt-provider/main.go
4343

4444

4545
# Install irictl-machine
4646
RUN --mount=type=cache,target=/root/.cache/go-build \
4747
--mount=type=cache,target=/go/pkg \
48-
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on \
48+
GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on \
4949
go install github.com/ironcore-dev/ironcore/irictl-machine/cmd/irictl-machine@main
5050

5151
# Ensure the binary is in a common location

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ vet: ## Run go vet against code.
8787

8888
.PHONY: lint
8989
lint: golangci-lint ## Run golangci-lint against code.
90-
CGO_ENABLED=1 $(GOLANGCI_LINT) run
90+
$(GOLANGCI_LINT) run
9191

9292
.PHONY: lint-fix
9393
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
94-
CGO_ENABLED=1 $(GOLANGCI_LINT) run --fix
94+
$(GOLANGCI_LINT) run --fix
9595

9696
.PHONY: check
9797
check: manifests generate fmt check-license lint test ## Generate manifests, code, lint, check licenses, test
@@ -119,7 +119,7 @@ clean-docs: ## Remove all local mkdocs Docker images (cleanup).
119119

120120
.PHONY: build
121121
build: manifests generate fmt vet add-license lint ## Build the binary
122-
CGO_ENABLED=1 go build -o $(LIBVIRT_PROVIDER_BIN) $(LIBVIRT_PROVIDER_BIN_SOURCE)
122+
go build -o $(LIBVIRT_PROVIDER_BIN) $(LIBVIRT_PROVIDER_BIN_SOURCE)
123123

124124
.PHONY: run
125125
run: manifests generate fmt vet ## Run the binary

0 commit comments

Comments
 (0)