Skip to content

Commit 6f94719

Browse files
authored
fix(build): mv gh release logic to release rule (#4145)
Continuation of #4141.
1 parent ef7d74e commit 6f94719

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

builder/Makefile.release

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,41 @@ release: \
154154
.check_$(CMD_TAR) \
155155
.check_$(CMD_CHECKSUM) \
156156
.check_$(CMD_GITHUB)
157+
#
158+
# note: TAGS created by release-snapshot workflow
159+
#
160+
161+
#
162+
# RELEASE
163+
#
164+
165+
ifneq ("$(SNAPSHOT)", "1")
166+
#
167+
# create release notes (x86_64 only, other arches will be added after release)
168+
#
169+
ifeq ($(ARCH),x86_64)
170+
$(CMD_TOUCH) $(RELEASE_NOTES)
171+
echo '## Docker Image' >> $(RELEASE_NOTES)
172+
echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):$(IMAGE_TAG)`' >> $(RELEASE_NOTES);
173+
echo ' ' >> $(RELEASE_NOTES);
174+
echo '## Docker Images (per architecture) ' >> $(RELEASE_NOTES)
175+
echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):x86_64-$(IMAGE_TAG)`' >> $(RELEASE_NOTES);
176+
echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):aarch64-$(IMAGE_TAG)`' >> $(RELEASE_NOTES);
177+
endif
178+
#
179+
# release it (x86_64 only, other arches will be added after release)
180+
#
181+
ifeq ($(ARCH),x86_64)
182+
$(CMD_GITHUB) release create $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS) --title $(SNAPSHOT_VERSION) --notes-file $(RELEASE_NOTES)
183+
endif
184+
#
185+
# add artifacts to the already created release (by x86_64 arch)
186+
#
187+
ifeq ($(ARCH),aarch64)
188+
$(CMD_GITHUB) release upload $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS)
189+
endif
190+
191+
endif
157192

158193
#
159194
# build tracee
@@ -197,42 +232,6 @@ archive:
197232
$(CMD_TAR) -cvzf $(OUT_ARCHIVE) $(RELEASE_FILES) && \
198233
$(CMD_CHECKSUM) $(OUT_ARCHIVE) > $(OUT_CHECKSUMS)
199234

200-
#
201-
# note: TAGS created by release-snapshot workflow
202-
#
203-
204-
#
205-
# RELEASE
206-
#
207-
208-
ifneq ("$(SNAPSHOT)", "1")
209-
#
210-
# create release notes (x86_64 only, other arches will be added after release)
211-
#
212-
ifeq ($(ARCH),x86_64)
213-
$(CMD_TOUCH) $(RELEASE_NOTES)
214-
echo '## Docker Image' >> $(RELEASE_NOTES)
215-
echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):$(IMAGE_TAG)`' >> $(RELEASE_NOTES);
216-
echo ' ' >> $(RELEASE_NOTES);
217-
echo '## Docker Images (per architecture) ' >> $(RELEASE_NOTES)
218-
echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):x86_64-$(IMAGE_TAG)`' >> $(RELEASE_NOTES);
219-
echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):aarch64-$(IMAGE_TAG)`' >> $(RELEASE_NOTES);
220-
endif
221-
#
222-
# release it (x86_64 only, other arches will be added after release)
223-
#
224-
ifeq ($(ARCH),x86_64)
225-
$(CMD_GITHUB) release create $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS) --title $(SNAPSHOT_VERSION) --notes-file $(RELEASE_NOTES)
226-
endif
227-
#
228-
# add artifacts to the already created release (by x86_64 arch)
229-
#
230-
ifeq ($(ARCH),aarch64)
231-
$(CMD_GITHUB) release upload $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS)
232-
endif
233-
234-
endif
235-
236235
.PHONY: clean
237236
clean:
238237
#

0 commit comments

Comments
 (0)