@@ -154,41 +154,39 @@ release: \
154
154
.check_$(CMD_TAR) \
155
155
.check_$(CMD_CHECKSUM) \
156
156
.check_$(CMD_GITHUB)
157
- #
158
- # note: TAGS created by release-snapshot workflow
159
- #
160
157
161
158
#
162
- # RELEASE
159
+ # release rule recipes
163
160
#
164
-
165
161
ifneq ("$(SNAPSHOT)", "1")
166
162
#
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)
163
+ # official release
164
+ #
165
+
166
+ # if not released yet, create a github release without artifacts.
167
+ # be aware that if changes are made to the release branch, the github release
168
+ # must be deleted so the next triggered action can recreate it updated.
169
+ # note: docker TAGS created by release workflows (not here).
170
+ @( \
171
+ $(CMD_GITHUB) release view $(SNAPSHOT_VERSION) > /dev/null 2>&1 && \
172
+ echo "Release $(SNAPSHOT_VERSION) already exists" \
173
+ ) || \
174
+ ( \
175
+ echo "Creating release $(SNAPSHOT_VERSION)" && \
176
+ echo '## Docker Image' > $(RELEASE_NOTES) && \
177
+ echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):$(IMAGE_TAG)`' >> $(RELEASE_NOTES) && \
178
+ echo ' ' >> $(RELEASE_NOTES) && \
179
+ echo '## Docker Images (per architecture) ' >> $(RELEASE_NOTES) && \
180
+ echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):x86_64-$(IMAGE_TAG)`' >> $(RELEASE_NOTES) && \
181
+ echo '- `docker pull docker.io/$(PUSH_DOCKER_REPO):aarch64-$(IMAGE_TAG)`' >> $(RELEASE_NOTES) && \
182
+ $(CMD_GITHUB) release create $(SNAPSHOT_VERSION) --title $(SNAPSHOT_VERSION) --notes-file $(RELEASE_NOTES) \
183
+ )
184
+
185
+ # upload artifacts to release (clobbering existing with same name)
186
+ @echo "Uploading artifacts to release $(SNAPSHOT_VERSION)" && \
187
+ $(CMD_GITHUB) release upload --clobber $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS)
189
188
endif
190
189
191
- endif
192
190
193
191
#
194
192
# build tracee
0 commit comments