always regen release.env unless REPRODUCE=true

This commit is contained in:
Lance Vick 2023-09-18 17:38:31 -07:00
parent a5ab6f8dcd
commit ec9175bf45
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
1 changed files with 3 additions and 4 deletions

View File

@ -57,7 +57,7 @@ include $(CONFIG_DIR)/make.env
export $(shell sed 's/=.*//' $(CONFIG_DIR)/make.env) export $(shell sed 's/=.*//' $(CONFIG_DIR)/make.env)
## Use env vars from existing release if present ## Use env vars from existing release if present
ifneq (,$(wildcard $(DIST_DIR)/release.env)) ifeq ($(REPRODUCE),"true")
include $(DIST_DIR)/release.env include $(DIST_DIR)/release.env
export export
endif endif
@ -141,8 +141,7 @@ toolchain-clean:
.PHONY: reproduce .PHONY: reproduce
reproduce: toolchain-clean reproduce: toolchain-clean
mkdir -p $(OUT_DIR) mkdir -p $(OUT_DIR)
cp $(DIST_DIR)/release.env $(OUT_DIR)/release.env $(MAKE) REPRODUCE="true"
$(MAKE) TARGET=$(TARGET) VERSION=$(VERSION)
diff -q $(OUT_DIR) $(DIST_DIR) \ diff -q $(OUT_DIR) $(DIST_DIR) \
&& echo "Success: $(OUT_DIR) and $(DIST_DIR) are identical" && echo "Success: $(OUT_DIR) and $(DIST_DIR) are identical"
@ -233,7 +232,7 @@ $(CACHE_DIR_ROOT)/toolchain.state: \
docker load -i $(CACHE_DIR_ROOT)/toolchain.tar docker load -i $(CACHE_DIR_ROOT)/toolchain.tar
docker images --no-trunc --quiet $(IMAGE) > $@ docker images --no-trunc --quiet $(IMAGE) > $@
$(OUT_DIR)/release.env: | $(OUT_DIR) $(OUT_DIR)/release.env: $(shell git ls-files)
echo 'VERSION=$(VERSION)' > $(OUT_DIR)/release.env echo 'VERSION=$(VERSION)' > $(OUT_DIR)/release.env
echo 'GIT_REF=$(GIT_REF)' >> $(OUT_DIR)/release.env echo 'GIT_REF=$(GIT_REF)' >> $(OUT_DIR)/release.env
echo 'GIT_AUTHOR=$(GIT_AUTHOR)' >> $(OUT_DIR)/release.env echo 'GIT_AUTHOR=$(GIT_AUTHOR)' >> $(OUT_DIR)/release.env