Skip to content

Commit 879d271

Browse files
committed
Work around limitations with actions-docker-build
1 parent 193d7b9 commit 879d271

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ jobs:
108108
run: |
109109
mkdir dist out
110110
make ci-build
111-
cd dist/${{ env.GOOS }}/${{ env.GOARCH }}/.
112-
zip -r --symlinks ../../../out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip .
111+
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip dist/${{ env.GOOS }}/${{ env.GOARCH }}/${{ env.PKG_NAME }}
113112
- name: Upload binaries
114113
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
115114
with:
@@ -126,9 +125,12 @@ jobs:
126125
env:
127126
repo: ${{github.event.repository.name}}
128127
version: ${{needs.get-product-version.outputs.product-version}}
129-
130128
steps:
131129
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
130+
- name: Setup scripts directory
131+
shell: bash
132+
run: |
133+
make ci-build-scripts-dir GOARCH="${{ matrix.arch }}"
132134
- name: Docker Build (Action)
133135
uses: hashicorp/actions-docker-build@v2
134136
env:
@@ -164,9 +166,12 @@ jobs:
164166
repo: ${{github.event.repository.name}}
165167
version: ${{needs.get-product-version.outputs.product-version}}
166168
image_tag: ${{needs.get-product-version.outputs.product-version}}-ubi
167-
168169
steps:
169170
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
171+
- name: Setup scripts directory
172+
shell: bash
173+
run: |
174+
make ci-build-scripts-dir GOARCH="${{ matrix.arch }}"
170175
- name: Docker Build (Action)
171176
uses: hashicorp/actions-docker-build@v2
172177
env:
@@ -204,9 +209,12 @@ jobs:
204209
repo: ${{github.event.repository.name}}
205210
version: ${{needs.get-product-version.outputs.product-version}}
206211
image_tag: ${{needs.get-product-version.outputs.product-version}}-ubi
207-
208212
steps:
209213
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
214+
- name: Setup scripts directory
215+
shell: bash
216+
run: |
217+
make ci-build-scripts-dir GOARCH="${{ matrix.arch }}"
210218
- name: Docker Build (Action)
211219
uses: hashicorp/actions-docker-build@v2
212220
env:

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,15 @@ docker-push: ## Push docker image with the manager.
272272

273273
##@ CI
274274

275-
.PHONY: ci-build
276-
ci-build: ## Build operator binary (without generating assets).
275+
.PHONY: ci-build-scripts-dir
276+
ci-build-scripts-dir: ## Build operator binary (without generating assets).
277277
rm -rf $(BUILD_DIR)/$(GOOS)/$(GOARCH)/scripts
278278
mkdir -p $(BUILD_DIR)/$(GOOS)/$(GOARCH)/scripts
279279
cp -a chart/crds $(BUILD_DIR)/$(GOOS)/$(GOARCH)/scripts/.
280280
ln -s ../$(BIN_NAME) $(BUILD_DIR)/$(GOOS)/$(GOARCH)/scripts/upgrade-crds
281+
282+
.PHONY: ci-build
283+
ci-build: ci-build-scripts-dir ## Build operator binary (without generating assets).
281284
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
282285
-ldflags "${LD_FLAGS} $(shell GOOS=$(GOOS) GOARCH=$(GOARCH) ./scripts/ldflags-version.sh)" \
283286
-a \

0 commit comments

Comments
 (0)