From e2488ec55267591c013aa12d545bc14088629148 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 14:52:43 +0000 Subject: [PATCH 1/7] Set version from git tag on release action --- .github/workflows/makeRelease.yml | 2 +- GNUmakefile.os4 | 48 ++++++++++++++++++++++++------- library/amiga/amiga.lib_rev.h | 20 +++++++++++-- library/c.lib_rev.h | 23 ++++++++++++--- library/crypt/crypt.lib_rev.h | 20 +++++++++++-- library/math/m.lib_rev.h | 20 +++++++++++-- library/ndbm/hash.h | 3 ++ library/pthread/pthread.lib_rev.h | 20 +++++++++++-- library/rt/rt.lib_rev.h | 20 +++++++++++-- 9 files changed, 145 insertions(+), 31 deletions(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index d8c1708e..d33a7b56 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 && \ diff --git a/GNUmakefile.os4 b/GNUmakefile.os4 index 6aa66620..bf391fd9 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 + 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,6 +132,32 @@ 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))) + + VERS_FLAGS = -DVERSION=$(MAJOR) -DREVISION=$(MINOR) \ + -DSUBREVISION=$(PATCH) -DDATE="$(DATESTR)" +else + VERS_FLAGS = -DDATE="$(DATESTR)" +endif + +CFLAGS := $(CFLAGS) $(VERS_FLAGS) + ############################################################################## # This is the first target: it depends on all the targets @@ -214,16 +240,16 @@ clean: ############################################################################## # Update the version numbers bound to the individual libraries -version: - $(COPY) c.lib_rev.rev amiga/amiga.lib_rev.rev - $(COPY) c.lib_rev.rev math/m.lib_rev.rev - $(COPY) c.lib_rev.rev math/crypt.lib_rev.rev - $(COPY) c.lib_rev.rev math/pthread.lib_rev.rev - bumprev amiga.lib - bumprev c.lib - bumprev m.lib - bumprev crypt.lib - bumprev pthread.lib +# version: +# $(COPY) c.lib_rev.rev amiga/amiga.lib_rev.rev +# $(COPY) c.lib_rev.rev math/m.lib_rev.rev +# $(COPY) c.lib_rev.rev math/crypt.lib_rev.rev +# $(COPY) c.lib_rev.rev math/pthread.lib_rev.rev +# bumprev amiga.lib +# bumprev c.lib +# bumprev m.lib +# bumprev crypt.lib +# bumprev pthread.lib # Shared clib4.library rules diff --git a/library/amiga/amiga.lib_rev.h b/library/amiga/amiga.lib_rev.h index 11c88b22..93c95cfe 100755 --- a/library/amiga/amiga.lib_rev.h +++ b/library/amiga/amiga.lib_rev.h @@ -1,8 +1,22 @@ +#ifndef VERSION #define VERSION 1 +#endif + +#ifndef REVISION #define REVISION 216 +#endif + +#ifndef SUBREVISION #define SUBREVISION 0 +#endif +#ifndef DATE #define DATE "08.02.2021" -#define VERS "amiga.lib 1.216" -#define VSTRING "amiga.lib 1.216 (08.02.2021)\r\n" -#define VERSTAG "\0$VER: amiga.lib 1.216 (08.02.2021)" +#endif + +#define STR_HELPER(s) #s //stringify argument +#define STR(s) STR_HELPER(s) //indirection to expand argument macros + +#define VERS "amiga.lib " STR(VERSION) "." STR(REVISION) +#define VSTRING "amiga.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" +#define VERSTAG "\0$VER: amiga.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index 8830cd48..30852d2a 100755 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -1,8 +1,23 @@ + +#ifndef VERSION #define VERSION 1 +#endif + +#ifndef REVISION #define REVISION 0 -#define SUBREVISION 0 +#endif + +#ifndef SUBREVISION +#define SUBREVISION 0 +#endif +#ifndef DATE #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)" +#endif + +#define STR_HELPER(s) #s //stringify argument +#define STR(s) STR_HELPER(s) //indirection to expand argument macros + +#define VERS "clib4.library " STR(VERSION) "." STR(REVISION) "." STR(SUBREVISION) +#define VSTRING "clib4.library " STR(VERSION) "." STR(REVISION) "." STR(SUBREVISION) " (" STR(DATE) ")\r\n" +#define VERSTAG "\0$VER: clib4.library " STR(VERSION) "." STR(REVISION) "." STR(SUBREVISION) " (" STR(DATE) ")" diff --git a/library/crypt/crypt.lib_rev.h b/library/crypt/crypt.lib_rev.h index 3ff2107c..5ca2ed10 100644 --- a/library/crypt/crypt.lib_rev.h +++ b/library/crypt/crypt.lib_rev.h @@ -1,9 +1,23 @@ +#ifndef VERSION #define VERSION 1 +#endif + +#ifndef REVISION #define REVISION 0 +#endif + +#ifndef SUBREVISION #define SUBREVISION 0 +#endif +#ifndef DATE #define DATE "29.07.2022" -#define VERS "crypt.lib 1.0" -#define VSTRING "crypt.lib 1.0 (29.07.2022)\r\n" -#define VERSTAG "\0$VER: crypt.lib 1.0 (29.07.2022)" +#endif + +#define STR_HELPER(s) #s //stringify argument +#define STR(s) STR_HELPER(s) //indirection to expand argument macros + +#define VERS "crypt.lib " STR(VERSION) "." STR(REVISION) +#define VSTRING "crypt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" +#define VERSTAG "\0$VER: crypt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" diff --git a/library/math/m.lib_rev.h b/library/math/m.lib_rev.h index 9c9b36e6..a72d7db4 100644 --- a/library/math/m.lib_rev.h +++ b/library/math/m.lib_rev.h @@ -1,9 +1,23 @@ +#ifndef VERSION #define VERSION 1 +#endif + +#ifndef REVISION #define REVISION 300 +#endif + +#ifndef SUBREVISION #define SUBREVISION 0 +#endif +#ifndef DATE #define DATE "14.03.2022" -#define VERS "m.lib 1.300" -#define VSTRING "m.lib 1.300 (14.03.2022)\r\n" -#define VERSTAG "\0$VER: m.lib 1.300 (14.03.2022)" +#endif + +#define STR_HELPER(s) #s //stringify argument +#define STR(s) STR_HELPER(s) //indirection to expand argument macros + +#define VERS "m.lib " STR(VERSION) "." STR(REVISION) +#define VSTRING "m.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" +#define VERSTAG "\0$VER: m.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" diff --git a/library/ndbm/hash.h b/library/ndbm/hash.h index 0b6a46db..21e2ebb8 100644 --- a/library/ndbm/hash.h +++ b/library/ndbm/hash.h @@ -238,6 +238,9 @@ typedef struct htab { /* Memory resident data structure */ #define HDRPAGES hdr.hdrpages #define SPARES hdr.spares #define BITMAPS hdr.bitmaps +#ifdef VERSION +#undef VERSION // Set from the GNUMakefile +#endif #define VERSION hdr.version #define MAGIC hdr.magic #define NEXT_FREE hdr.next_free diff --git a/library/pthread/pthread.lib_rev.h b/library/pthread/pthread.lib_rev.h index fe3cb09f..adac34d4 100644 --- a/library/pthread/pthread.lib_rev.h +++ b/library/pthread/pthread.lib_rev.h @@ -1,9 +1,23 @@ +#ifndef VERSION #define VERSION 1 +#endif + +#ifndef REVISION #define REVISION 0 +#endif + +#ifndef SUBREVISION #define SUBREVISION 0 +#endif +#ifndef DATE #define DATE "18.07.2022" -#define VERS "pthread.lib 1.0" -#define VSTRING "pthread.lib 1.0 (18.07.2022)\r\n" -#define VERSTAG "\0$VER: pthread.lib 1.0 (18.07.2022)" +#endif + +#define STR_HELPER(s) #s //stringify argument +#define STR(s) STR_HELPER(s) //indirection to expand argument macros + +#define VERS "pthread.lib " STR(VERSION) "." STR(REVISION) +#define VSTRING "pthread.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" +#define VERSTAG "\0$VER: pthread.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" diff --git a/library/rt/rt.lib_rev.h b/library/rt/rt.lib_rev.h index 09d555d0..3ca4f14b 100644 --- a/library/rt/rt.lib_rev.h +++ b/library/rt/rt.lib_rev.h @@ -1,9 +1,23 @@ +#ifndef VERSION #define VERSION 1 +#endif + +#ifndef REVISION #define REVISION 0 +#endif + +#ifndef SUBREVISION #define SUBREVISION 0 +#endif +#ifndef DATE #define DATE "27.04.2023" -#define VERS "rt.lib 1.0" -#define VSTRING "rt.lib 1.0 (27.04.2023)\r\n" -#define VERSTAG "\0$VER: rt.lib 1.0 (27.04.2023)" +#endif + +#define STR_HELPER(s) #s //stringify argument +#define STR(s) STR_HELPER(s) //indirection to expand argument macros + +#define VERS "rt.lib " STR(VERSION) "." STR(REVISION) +#define VSTRING "rt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" +#define VERSTAG "\0$VER: rt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" From d80a03aee95c388dfc96f17c70c78a8bba94f080 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 14:56:40 +0000 Subject: [PATCH 2/7] A small teml change in action --- .github/workflows/makeRelease.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index d33a7b56..df3251e8 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -3,6 +3,7 @@ on: release: branches: - master + - add-version-while-compile types: - published From 6a4bb717e2b101bc2c8a553446d51a5b39e20330 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 15:01:50 +0000 Subject: [PATCH 3/7] Disabled Upload DEB release file to the server for the tests --- .github/workflows/makeRelease.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index df3251e8..10a3fa46 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -47,19 +47,19 @@ jobs: asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}_amd64.deb 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 + # - 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 # - name: Prepare OS4Depot release # run: | # mkdir os4depot-release From 5083ca55d47c4fd84992923f8ccd888642bdca25 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 17:51:46 +0000 Subject: [PATCH 4/7] Reversed previous changes and used sed --- GNUmakefile.os4 | 41 +++++++++++++++++-------------- library/amiga/amiga.lib_rev.h | 20 +++------------ library/c.lib_rev.h | 31 ++++++----------------- library/crypt/crypt.lib_rev.h | 20 +++------------ library/math/m.lib_rev.h | 20 +++------------ library/ndbm/hash.h | 3 --- library/pthread/pthread.lib_rev.h | 20 +++------------ library/rt/rt.lib_rev.h | 20 +++------------ 8 files changed, 45 insertions(+), 130 deletions(-) diff --git a/GNUmakefile.os4 b/GNUmakefile.os4 index bf391fd9..7ca6a0e9 100644 --- a/GNUmakefile.os4 +++ b/GNUmakefile.os4 @@ -8,7 +8,7 @@ ############################################################################## .PHONY : all prepare all-targets all-libs clean \ - 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 @@ -149,20 +149,13 @@ ifneq ($(origin GITTAG),undefined) MAJOR = $(patsubst v%,%,$(firstword $(subst ., ,$(GITTAG)))) MINOR = $(word 2, $(subst ., ,$(GITTAG))) PATCH = $(word 3, $(subst ., ,$(GITTAG))) - - VERS_FLAGS = -DVERSION=$(MAJOR) -DREVISION=$(MINOR) \ - -DSUBREVISION=$(PATCH) -DDATE="$(DATESTR)" -else - VERS_FLAGS = -DDATE="$(DATESTR)" endif -CFLAGS := $(CFLAGS) $(VERS_FLAGS) - ############################################################################## # This is the first target: it depends on all the targets -all: prepare all-targets all-libs clib4.library.debug clib4.library +all: prepare gitver all-targets all-libs clib4.library.debug clib4.library ############################################################################## @@ -239,17 +232,27 @@ clean: ############################################################################## +gitver: + sed -i 's/[(]\([0-9]*\.[0-9]*\.[0-9]*\)[)]/($(DATESTR))/g' library/c.lib_rev.h + sed -i 's/"\([0-9]*\.[0-9]*\.[0-9]*\)"/"$(DATESTR)"/g' library/c.lib_rev.h +ifdef GITTAG + sed -i 's/VERSION\t*[[:digit:]]/VERSION $(MAJOR)/g' library/c.lib_rev.h + sed -i 's/REVISION\t*[[:digit:]]/REVISION $(MINOR)/g' library/c.lib_rev.h + sed -i 's/SUBREVISION\t*[[:digit:]]/SUBREVISION $(PATCH)/g' library/c.lib_rev.h + 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 -# $(COPY) c.lib_rev.rev math/m.lib_rev.rev -# $(COPY) c.lib_rev.rev math/crypt.lib_rev.rev -# $(COPY) c.lib_rev.rev math/pthread.lib_rev.rev -# bumprev amiga.lib -# bumprev c.lib -# bumprev m.lib -# bumprev crypt.lib -# bumprev pthread.lib +version: + $(COPY) c.lib_rev.rev amiga/amiga.lib_rev.rev + $(COPY) c.lib_rev.rev math/m.lib_rev.rev + $(COPY) c.lib_rev.rev math/crypt.lib_rev.rev + $(COPY) c.lib_rev.rev math/pthread.lib_rev.rev + bumprev amiga.lib + bumprev c.lib + bumprev m.lib + bumprev crypt.lib + bumprev pthread.lib # Shared clib4.library rules diff --git a/library/amiga/amiga.lib_rev.h b/library/amiga/amiga.lib_rev.h index 93c95cfe..11c88b22 100755 --- a/library/amiga/amiga.lib_rev.h +++ b/library/amiga/amiga.lib_rev.h @@ -1,22 +1,8 @@ -#ifndef VERSION #define VERSION 1 -#endif - -#ifndef REVISION #define REVISION 216 -#endif - -#ifndef SUBREVISION #define SUBREVISION 0 -#endif -#ifndef DATE #define DATE "08.02.2021" -#endif - -#define STR_HELPER(s) #s //stringify argument -#define STR(s) STR_HELPER(s) //indirection to expand argument macros - -#define VERS "amiga.lib " STR(VERSION) "." STR(REVISION) -#define VSTRING "amiga.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" -#define VERSTAG "\0$VER: amiga.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" +#define VERS "amiga.lib 1.216" +#define VSTRING "amiga.lib 1.216 (08.02.2021)\r\n" +#define VERSTAG "\0$VER: amiga.lib 1.216 (08.02.2021)" diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index 30852d2a..715cdb2e 100755 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -1,23 +1,8 @@ - -#ifndef VERSION -#define VERSION 1 -#endif - -#ifndef REVISION -#define REVISION 0 -#endif - -#ifndef SUBREVISION -#define SUBREVISION 0 -#endif - -#ifndef DATE -#define DATE "27.09.2023" -#endif - -#define STR_HELPER(s) #s //stringify argument -#define STR(s) STR_HELPER(s) //indirection to expand argument macros - -#define VERS "clib4.library " STR(VERSION) "." STR(REVISION) "." STR(SUBREVISION) -#define VSTRING "clib4.library " STR(VERSION) "." STR(REVISION) "." STR(SUBREVISION) " (" STR(DATE) ")\r\n" -#define VERSTAG "\0$VER: clib4.library " STR(VERSION) "." STR(REVISION) "." STR(SUBREVISION) " (" STR(DATE) ")" +#define VERSION 1 +#define REVISION 2 +#define SUBREVISION 2 + +#define DATE "16.03.2024" +#define VERS "clib4.library 1.2.3" +#define VSTRING "clib4.library 1.2.3 (16.03.2024)\r\n" +#define VERSTAG "\0$VER: clib4.library 1.2.3 (16.03.2024)" diff --git a/library/crypt/crypt.lib_rev.h b/library/crypt/crypt.lib_rev.h index 5ca2ed10..3ff2107c 100644 --- a/library/crypt/crypt.lib_rev.h +++ b/library/crypt/crypt.lib_rev.h @@ -1,23 +1,9 @@ -#ifndef VERSION #define VERSION 1 -#endif - -#ifndef REVISION #define REVISION 0 -#endif - -#ifndef SUBREVISION #define SUBREVISION 0 -#endif -#ifndef DATE #define DATE "29.07.2022" -#endif - -#define STR_HELPER(s) #s //stringify argument -#define STR(s) STR_HELPER(s) //indirection to expand argument macros - -#define VERS "crypt.lib " STR(VERSION) "." STR(REVISION) -#define VSTRING "crypt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" -#define VERSTAG "\0$VER: crypt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" +#define VERS "crypt.lib 1.0" +#define VSTRING "crypt.lib 1.0 (29.07.2022)\r\n" +#define VERSTAG "\0$VER: crypt.lib 1.0 (29.07.2022)" diff --git a/library/math/m.lib_rev.h b/library/math/m.lib_rev.h index a72d7db4..9c9b36e6 100644 --- a/library/math/m.lib_rev.h +++ b/library/math/m.lib_rev.h @@ -1,23 +1,9 @@ -#ifndef VERSION #define VERSION 1 -#endif - -#ifndef REVISION #define REVISION 300 -#endif - -#ifndef SUBREVISION #define SUBREVISION 0 -#endif -#ifndef DATE #define DATE "14.03.2022" -#endif - -#define STR_HELPER(s) #s //stringify argument -#define STR(s) STR_HELPER(s) //indirection to expand argument macros - -#define VERS "m.lib " STR(VERSION) "." STR(REVISION) -#define VSTRING "m.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" -#define VERSTAG "\0$VER: m.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" +#define VERS "m.lib 1.300" +#define VSTRING "m.lib 1.300 (14.03.2022)\r\n" +#define VERSTAG "\0$VER: m.lib 1.300 (14.03.2022)" diff --git a/library/ndbm/hash.h b/library/ndbm/hash.h index 21e2ebb8..0b6a46db 100644 --- a/library/ndbm/hash.h +++ b/library/ndbm/hash.h @@ -238,9 +238,6 @@ typedef struct htab { /* Memory resident data structure */ #define HDRPAGES hdr.hdrpages #define SPARES hdr.spares #define BITMAPS hdr.bitmaps -#ifdef VERSION -#undef VERSION // Set from the GNUMakefile -#endif #define VERSION hdr.version #define MAGIC hdr.magic #define NEXT_FREE hdr.next_free diff --git a/library/pthread/pthread.lib_rev.h b/library/pthread/pthread.lib_rev.h index adac34d4..fe3cb09f 100644 --- a/library/pthread/pthread.lib_rev.h +++ b/library/pthread/pthread.lib_rev.h @@ -1,23 +1,9 @@ -#ifndef VERSION #define VERSION 1 -#endif - -#ifndef REVISION #define REVISION 0 -#endif - -#ifndef SUBREVISION #define SUBREVISION 0 -#endif -#ifndef DATE #define DATE "18.07.2022" -#endif - -#define STR_HELPER(s) #s //stringify argument -#define STR(s) STR_HELPER(s) //indirection to expand argument macros - -#define VERS "pthread.lib " STR(VERSION) "." STR(REVISION) -#define VSTRING "pthread.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" -#define VERSTAG "\0$VER: pthread.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" +#define VERS "pthread.lib 1.0" +#define VSTRING "pthread.lib 1.0 (18.07.2022)\r\n" +#define VERSTAG "\0$VER: pthread.lib 1.0 (18.07.2022)" diff --git a/library/rt/rt.lib_rev.h b/library/rt/rt.lib_rev.h index 3ca4f14b..09d555d0 100644 --- a/library/rt/rt.lib_rev.h +++ b/library/rt/rt.lib_rev.h @@ -1,23 +1,9 @@ -#ifndef VERSION #define VERSION 1 -#endif - -#ifndef REVISION #define REVISION 0 -#endif - -#ifndef SUBREVISION #define SUBREVISION 0 -#endif -#ifndef DATE #define DATE "27.04.2023" -#endif - -#define STR_HELPER(s) #s //stringify argument -#define STR(s) STR_HELPER(s) //indirection to expand argument macros - -#define VERS "rt.lib " STR(VERSION) "." STR(REVISION) -#define VSTRING "rt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")\r\n" -#define VERSTAG "\0$VER: rt.lib " STR(VERSION) "." STR(REVISION) " (" STR(DATE) ")" +#define VERS "rt.lib 1.0" +#define VSTRING "rt.lib 1.0 (27.04.2023)\r\n" +#define VERSTAG "\0$VER: rt.lib 1.0 (27.04.2023)" From ae2761d0b1c5627a4a8e492e39a42fb0b7f23289 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 18:45:47 +0000 Subject: [PATCH 5/7] Reverse changes --- library/c.lib_rev.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index 715cdb2e..f8519237 100755 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -1,8 +1,8 @@ -#define VERSION 1 -#define REVISION 2 -#define SUBREVISION 2 +#define VERSION 1 +#define REVISION 0 +#define SUBREVISION 0 -#define DATE "16.03.2024" -#define VERS "clib4.library 1.2.3" -#define VSTRING "clib4.library 1.2.3 (16.03.2024)\r\n" -#define VERSTAG "\0$VER: clib4.library 1.2.3 (16.03.2024)" +#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)" \ No newline at end of file From 38f1fea9684a11c9d6db4c78e383b7e74f7d63f2 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 19:06:10 +0000 Subject: [PATCH 6/7] Some fixes in makefile --- GNUmakefile.os4 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/GNUmakefile.os4 b/GNUmakefile.os4 index 7ca6a0e9..6ee0cef4 100644 --- a/GNUmakefile.os4 +++ b/GNUmakefile.os4 @@ -146,16 +146,16 @@ DATESTR = $(shell date "+%d.%m.%Y") # 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))) +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 gitver all-targets all-libs clib4.library.debug clib4.library +all: gitver prepare all-targets all-libs clib4.library.debug clib4.library ############################################################################## @@ -201,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) @@ -236,10 +236,10 @@ gitver: sed -i 's/[(]\([0-9]*\.[0-9]*\.[0-9]*\)[)]/($(DATESTR))/g' library/c.lib_rev.h sed -i 's/"\([0-9]*\.[0-9]*\.[0-9]*\)"/"$(DATESTR)"/g' library/c.lib_rev.h ifdef GITTAG - sed -i 's/VERSION\t*[[:digit:]]/VERSION $(MAJOR)/g' library/c.lib_rev.h - sed -i 's/REVISION\t*[[:digit:]]/REVISION $(MINOR)/g' library/c.lib_rev.h - sed -i 's/SUBREVISION\t*[[:digit:]]/SUBREVISION $(PATCH)/g' library/c.lib_rev.h - sed -i 's/clib4.library [0-9]*\.[0-9]*\.[0-9]*/clib4.library $(MAJOR).$(MINOR).$(PATCH)/g' library/c.lib_rev.h + sed -i 's/VERSION\t*[[:digit:]]/VERSION\t\t\t$(MAJOR)/g' library/c.lib_rev.h + sed -i 's/REVISION\t*[[:digit:]]/REVISION\t\t$(MINOR)/g' library/c.lib_rev.h + sed -i 's/SUBREVISION\t*[[:digit:]]/SUBREVISION\t\t$(PATCH)/g' library/c.lib_rev.h + 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 From 6e479f534b29dfbb087dacf106bc91008f8b6f25 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sat, 16 Mar 2024 19:14:19 +0000 Subject: [PATCH 7/7] Minor changes before PR --- .github/workflows/makeRelease.yml | 27 +++++++++++++-------------- GNUmakefile.os4 | 12 ++++++------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index 10a3fa46..40e8ef21 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -3,7 +3,6 @@ on: release: branches: - master - - add-version-while-compile types: - published @@ -47,19 +46,19 @@ jobs: asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}_amd64.deb 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 + - 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 # - name: Prepare OS4Depot release # run: | # mkdir os4depot-release diff --git a/GNUmakefile.os4 b/GNUmakefile.os4 index 6ee0cef4..cee3149d 100644 --- a/GNUmakefile.os4 +++ b/GNUmakefile.os4 @@ -233,13 +233,13 @@ clean: ############################################################################## gitver: - sed -i 's/[(]\([0-9]*\.[0-9]*\.[0-9]*\)[)]/($(DATESTR))/g' library/c.lib_rev.h - 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 + $(VERBOSE)sed -i 's/"\([0-9]*\.[0-9]*\.[0-9]*\)"/"$(DATESTR)"/g' library/c.lib_rev.h ifdef GITTAG - sed -i 's/VERSION\t*[[:digit:]]/VERSION\t\t\t$(MAJOR)/g' library/c.lib_rev.h - sed -i 's/REVISION\t*[[:digit:]]/REVISION\t\t$(MINOR)/g' library/c.lib_rev.h - sed -i 's/SUBREVISION\t*[[:digit:]]/SUBREVISION\t\t$(PATCH)/g' library/c.lib_rev.h - sed -i 's/clib4.library [0-9]*\.[0-9]*\.[0-9]*/clib4.library $(MAJOR).$(MINOR).$(PATCH)/g' library/c.lib_rev.h + $(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