diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index d8c1708e..40e8ef21 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -20,7 +20,7 @@ jobs: - name: Compile clib4 run: | cd /opt/code && \ - make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no + make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no GITTAG=${{ github.event.release.tag_name }} - name: Create the LHA release archive run: | make -f GNUmakefile.os4 release && \ @@ -47,18 +47,18 @@ jobs: asset_name: clib4-${{ github.event.release.tag_name }}_amd64.deb asset_content_type: application/vnd.debian.binary-pac - name: Upload DEB release file to the server - uses: kostya-ten/ssh-server-deploy@v4 - with: - host: ${{ secrets.DEBSERVER_HOST }} - port: ${{ secrets.DEBSERVER_PORT }} - username: ${{ secrets.DEBSERVER_USERNAME }} - private_key: ${{ secrets.DEBSERVER_PRIVATE_KEY }} - scp_source: clib4-${{ github.event.release.tag_name }}_amd64.deb - scp_target: /opt/amigarepo/ubuntu/pool/main - before_script: | - rm /opt/amigarepo/ubuntu/pool/main/clib4*.deb - after_script: | - /root/regenerate-packages.sh + uses: kostya-ten/ssh-server-deploy@v4 + with: + host: ${{ secrets.DEBSERVER_HOST }} + port: ${{ secrets.DEBSERVER_PORT }} + username: ${{ secrets.DEBSERVER_USERNAME }} + private_key: ${{ secrets.DEBSERVER_PRIVATE_KEY }} + scp_source: clib4-${{ github.event.release.tag_name }}_amd64.deb + scp_target: /opt/amigarepo/ubuntu/pool/main + before_script: | + rm /opt/amigarepo/ubuntu/pool/main/clib4*.deb + after_script: | + /root/regenerate-packages.sh # - name: Prepare OS4Depot release # run: | # mkdir os4depot-release diff --git a/GNUmakefile.os4 b/GNUmakefile.os4 index 6aa66620..cee3149d 100644 --- a/GNUmakefile.os4 +++ b/GNUmakefile.os4 @@ -8,7 +8,7 @@ ############################################################################## .PHONY : all prepare all-targets all-libs clean \ - version compile-tests install release dpkg + gitver version compile-tests install release dpkg # You may have to change the following sets of macro definitions which will # be used throughout the build makefile. These definitions cover the paths @@ -132,11 +132,30 @@ endif VERBOSE ?= @ +########################################################################## +# Set up version and date properties +########################################################################## + +DATEISO = $(shell date --iso=date) +DATESTR = $(shell date "+%d.%m.%Y") + +# Parse the repo tag to different defines, that will be used while +# compiling clib4 library +# +# The tags should be like v(MAJOR).(MINOR).(PATCH) +# in example v1.2.3 +# +ifneq ($(origin GITTAG),undefined) +MAJOR = $(patsubst v%,%,$(firstword $(subst ., ,$(GITTAG)))) +MINOR = $(word 2, $(subst ., ,$(GITTAG))) +PATCH = $(word 3, $(subst ., ,$(GITTAG))) +endif + ############################################################################## # This is the first target: it depends on all the targets -all: prepare all-targets all-libs clib4.library.debug clib4.library +all: gitver prepare all-targets all-libs clib4.library.debug clib4.library ############################################################################## @@ -182,12 +201,12 @@ ALL_TARGETS = \ $(OUTPUT_LIB)/crtend.o \ $(OUTPUT_LIB)/shcrtbegin.o \ $(OUTPUT_LIB)/shcrtend.o \ - $(OUT_SHARED_LIB)/shared_library/clib4.o \ - $(OUT_SHARED_LIB)/shared_library/math.o \ + $(OUT_SHARED_LIB)/shared_library/clib4.o \ + $(OUT_SHARED_LIB)/shared_library/math.o \ $(MAIN_LIB) ifdef SPE - ALL_TARGETS := PatchForSPE | $(ALL_TARGETS) + ALL_TARGETS := PatchForSPE | $(ALL_TARGETS) endif all-targets: $(ALL_TARGETS) @@ -213,6 +232,16 @@ clean: ############################################################################## +gitver: + $(VERBOSE)sed -i 's/[(]\([0-9]*\.[0-9]*\.[0-9]*\)[)]/($(DATESTR))/g' library/c.lib_rev.h + $(VERBOSE)sed -i 's/"\([0-9]*\.[0-9]*\.[0-9]*\)"/"$(DATESTR)"/g' library/c.lib_rev.h +ifdef GITTAG + $(VERBOSE)sed -i 's/VERSION\t*[[:digit:]]/VERSION\t\t\t$(MAJOR)/g' library/c.lib_rev.h + $(VERBOSE)sed -i 's/REVISION\t*[[:digit:]]/REVISION\t\t$(MINOR)/g' library/c.lib_rev.h + $(VERBOSE)sed -i 's/SUBREVISION\t*[[:digit:]]/SUBREVISION\t\t$(PATCH)/g' library/c.lib_rev.h + $(VERBOSE)sed -i 's/clib4.library [0-9]*\.[0-9]*\.[0-9]*/clib4.library $(MAJOR).$(MINOR).$(PATCH)/g' library/c.lib_rev.h +endif + # Update the version numbers bound to the individual libraries version: $(COPY) c.lib_rev.rev amiga/amiga.lib_rev.rev diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index 8830cd48..f8519237 100755 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -1,8 +1,8 @@ #define VERSION 1 #define REVISION 0 -#define SUBREVISION 0 +#define SUBREVISION 0 #define DATE "27.09.2023" #define VERS "clib4.library 1.0.0" #define VSTRING "clib4.library 1.0.0 (27.09.2023)\r\n" -#define VERSTAG "\0$VER: clib4.library 1.0.0 (27.09.2023)" +#define VERSTAG "\0$VER: clib4.library 1.0.0 (27.09.2023)" \ No newline at end of file