]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
chore: update build system to publish signed github releases
authorRoy Marples <roy@marples.name>
Thu, 20 Apr 2023 11:00:32 +0000 (12:00 +0100)
committerRoy Marples <roy@marples.name>
Thu, 20 Apr 2023 11:02:48 +0000 (12:02 +0100)
We rely on the GitHub CLI tools to do this.
We publish the compressed source tarball and a detached PGP
signature for it.
We add the SHA256 checksum of the tarball as a note on the release.
Automatic links to the changes are also given.

Makefile
Makefile.inc

index 53f61063476b95284320e5c077312edb32a63dd4..db6ad77464d1eb241937455e51a16e3657055f62 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,10 +9,10 @@ GITREF?=      HEAD
 
 DISTSUFFIX=
 DISTPREFIX?=   dhcpcd-${VERSION}${DISTSUFFIX}
-DISTFILEGZ?=   ${DISTPREFIX}.tar.gz
 DISTFILE?=     ${DISTPREFIX}.tar.xz
 DISTINFO=      ${DISTFILE}.distinfo
-DISTINFOSIGN=  ${DISTINFO}.asc
+DISTINFOMD=    ${DISTINFO}.md
+DISTSIGN=      ${DISTFILE}.asc
 
 CLEANFILES+=   *.tar.xz
 
@@ -49,29 +49,39 @@ clean:
 
 distclean: clean
        rm -f config.h config.mk config.log \
-               ${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
+               ${DISTFILE} ${DISTINFO} ${DISTINFOMD} ${DISTSIGN}
        rm -f *.diff *.patch *.orig *.rej
        for x in ${SUBDIRS} tests; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 dist-git:
-       git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+       git archive --prefix=${DISTPREFIX}/ v${VERSION} | xz >${DISTFILE}
 
 dist-inst:
        mkdir /tmp/${DISTPREFIX}
        cp -RPp * /tmp/${DISTPREFIX}
        (cd /tmp/${DISTPREFIX}; make clean)
-       tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
+       tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX}
        rm -rf /tmp/${DISTPREFIX}
 
 dist: ${DIST}
 
 distinfo: dist
-       rm -f ${DISTINFO} ${DISTINFOSIGN}
-       ${CKSUM} ${DISTFILE} >${DISTINFO}
-       #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO}
-       ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
-       chmod 644 ${DISTINFOSIGN}
-       ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+       rm -f ${DISTINFO} ${DISTSIGN}
+       ${SHA256} ${DISTFILE} >${DISTINFO}
+       ${PGP} --armour --detach-sign ${DISTFILE}
+       chmod 644 ${DISTSIGN}
+       ls -l ${DISTFILE} ${DISTINFO} ${DISTSIGN}
+
+{$DISTINFOMD}: ${DISTINFO}
+       echo '```' >${DISTINFOMD}
+       cat ${DISTINFO} >>${DISTINFOMD}
+       echo '```' >>${DISTINFOMD}
+
+release: distinfo
+       gh release create v${VERSION} \
+               --title "dhcpcd ${VERSION}" --draft --generate-notes \
+               --notes-file ${DISTINFOMD} \
+               ${DISTFILE} ${DISTSIGN}
 
 snapshot:
        rm -rf /tmp/${DISTPREFIX}
index 18b2824dd172ac5e67fe2d34030fec1cefb89b5f..de18984da50efb621346d80b82fc6c38dd4be126 100644 (file)
@@ -15,9 +15,12 @@ LINT?=               lint
 SED?=          sed
 HOST_SH?=      /bin/sh
 
-# This isn't very portable, but I generaly make releases from NetBSD
-CKSUM?=                cksum -a SHA256
-PGP?=          netpgp
+# This isn't very portable, but I generaly make releases from DragonFlyBSD
+SHA256?=       sha256
+PGP?=          gpg
+# old NetBSD defs
+#SHA256?=              cksum -a SHA256
+#PGP?=         netpgp
 
 SCRIPT=                ${LIBEXECDIR}/dhcpcd-run-hooks
 HOOKDIR=       ${LIBEXECDIR}/dhcpcd-hooks