@@ -18,6 +18,11 @@ COMMIT := $(shell git describe --abbrev=40 --dirty --tags)
1818COMMIT_HASH := $(shell git rev-parse HEAD)
1919PUBLIC_URL :=
2020
21+ # GO_VERSION is the Go version used for the release build, docker files, and
22+ # GitHub Actions. This is the reference version for the project. All other Go
23+ # versions are checked against this version.
24+ GO_VERSION = 1.22.6
25+
2126LOOP_COMMIT := $(shell cat go.mod | \
2227 grep $(LOOP_PKG ) | \
2328 head -n1 | \
@@ -159,9 +164,25 @@ app-build: yarn-install
159164 @$(call print, "Building production app.")
160165 cd app; yarn build
161166
162- release : app-build
167+ docker-app-build :
168+ @$(call print, "Building production app in docker.")
169+ cd app; ./gen_app_docker.sh
170+
171+ release : docker-app-build go-release
172+
173+ go-release :
163174 @$(call print, "Creating release of lightning-terminal.")
164- ./release.sh build-release " $( VERSION_TAG) " " $( BUILD_SYSTEM) " " $( LND_RELEASE_TAGS) " " $( RELEASE_LDFLAGS) "
175+ ./scripts/release.sh build-release " $( VERSION_TAG) " " $( BUILD_SYSTEM) " " $( LND_RELEASE_TAGS) " " $( RELEASE_LDFLAGS) " " $( GO_VERSION) "
176+
177+ docker-release : docker-app-build
178+ @$(call print, "Building release helper docker image.")
179+ if [ " $( tag) " = " " ]; then echo " Must specify tag=<commit_or_tag>!" ; exit 1; fi
180+
181+ docker build -t litd-release-helper -f make/builder.Dockerfile make/
182+
183+ # Run the actual compilation inside the docker image. We pass in all flags
184+ # that we might want to overwrite in manual tests.
185+ $(DOCKER_RELEASE_HELPER) make go-release tag="$(tag)" sys="$(sys)" COMMIT="$(COMMIT)"
165186
166187docker-tools :
167188 @$(call print, "Building tools docker image.")
@@ -226,7 +247,17 @@ fmt: $(GOIMPORTS_BIN)
226247 @$(call print, "Formatting source.")
227248 gofmt -l -w -s $(GOFILES_NOVENDOR )
228249
229- lint : docker-tools
250+ check-go-version-yaml :
251+ @$(call print, "Checking for target Go version (v$(GO_VERSION ) ) in YAML files (* .yaml, * .yml)" )
252+ ./scripts/check-go-version-yaml.sh $(GO_VERSION )
253+
254+ check-go-version-dockerfile :
255+ @$(call print, "Checking for target Go version (v$(GO_VERSION ) ) in Dockerfile files (* Dockerfile)" )
256+ ./scripts/check-go-version-dockerfile.sh $(GO_VERSION )
257+
258+ check-go-version : check-go-version-dockerfile check-go-version-yaml
259+
260+ lint : check-go-version docker-tools
230261 @$(call print, "Linting source.")
231262 $(DOCKER_TOOLS ) golangci-lint run -v $(LINT_WORKERS )
232263
@@ -267,3 +298,11 @@ clean: clean-itest
267298 $(RM ) ./litcli-debug
268299 $(RM ) ./litd-debug
269300 $(RM ) coverage.txt
301+
302+ # Prevent make from interpreting any of the defined goals as folders or files to
303+ # include in the build process.
304+ .PHONY : default all yarn-install build install go-build go-build-noui \
305+ go-install go-install-noui go-install-cli app-build release go-release \
306+ docker-release docker-tools scratch check unit unit-cover unit-race \
307+ clean-itest build-itest itest-only itest flake-unit fmt lint mod mod-check \
308+ list rpc protos protos-check rpc-js-compile clean
0 commit comments