mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 16:47:37 +00:00
Change versioning and save binaries as CI artifacts
For development versions of Stockfish, the version will now look like dev-20221107-dca9a0533 indicating a development version, the date of the last commit, and the git SHA of that commit. If git is not available, the fallback is the date of compilation. Releases will continue to be versioned as before. Additionally, this PR extends the CI to create binary artifacts, i.e. pushes to master will automatically build Stockfish and upload the binaries to github. closes https://github.com/official-stockfish/Stockfish/pull/4220 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
ad2aa8c06f
commit
e048d11825
+17
-1
@@ -682,6 +682,18 @@ ifeq ($(pext),yes)
|
||||
endif
|
||||
endif
|
||||
|
||||
### 3.7.1 Try to include git commit sha for versioning
|
||||
GIT_SHA = $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
ifneq ($(GIT_SHA), )
|
||||
CXXFLAGS += -DGIT_SHA=\"$(GIT_SHA)\"
|
||||
endif
|
||||
|
||||
### 3.7.2 Try to include git commit date for versioning
|
||||
GIT_DATE = $(shell git show -s --date=format:'%Y%m%d' --format=%cd HEAD 2>/dev/null)
|
||||
ifneq ($(GIT_DATE), )
|
||||
CXXFLAGS += -DGIT_DATE=\"$(GIT_DATE)\"
|
||||
endif
|
||||
|
||||
### 3.8 Link Time Optimization
|
||||
### This is a mix of compile and link time options because the lto link phase
|
||||
### needs access to the optimization flags.
|
||||
@@ -800,7 +812,7 @@ endif
|
||||
|
||||
.PHONY: help build profile-build strip install clean net objclean profileclean \
|
||||
config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
|
||||
clang-profile-use clang-profile-make
|
||||
clang-profile-use clang-profile-make FORCE
|
||||
|
||||
build: net config-sanity
|
||||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
|
||||
@@ -948,6 +960,10 @@ config-sanity: net
|
||||
$(EXE): $(OBJS)
|
||||
+$(CXX) -o $@ $(OBJS) $(LDFLAGS)
|
||||
|
||||
# Force recompilation to ensure version info is up-to-date
|
||||
misc.o: FORCE
|
||||
FORCE:
|
||||
|
||||
clang-profile-make:
|
||||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
|
||||
EXTRACXXFLAGS='-fprofile-instr-generate ' \
|
||||
|
||||
Reference in New Issue
Block a user