[build] Allow for generation of all release information

Allow for automatic generation of the release name, release title, and
release notes (derived from the relevant section of the changelog).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-02-20 14:53:30 +00:00
parent a82e0b41af
commit 9e0057a864
4 changed files with 120 additions and 5 deletions
+32
View File
@@ -509,6 +509,37 @@ jobs:
path: |
ipxeboot.tar.gz
version:
name: Version
runs-on: ubuntu-latest
container:
image: ghcr.io/ipxe/ipxe-builder-utils
env:
bindir: bin
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Build
working-directory: src
run: |
make ${{ env.bindir }}/version.txt \
${{ env.bindir }}/relname.txt \
${{ env.bindir }}/reltitle.txt \
${{ env.bindir }}/relnotes.md
- name: Upload
uses: actions/upload-artifact@v6
with:
name: version
if-no-files-found: error
path: |
src/${{ env.bindir }}/version.txt
src/${{ env.bindir }}/relname.txt
src/${{ env.bindir }}/reltitle.txt
src/${{ env.bindir }}/relnotes.md
publish:
name: Publish
runs-on: ubuntu-latest
@@ -521,6 +552,7 @@ jobs:
- shim
- combine
- netboot
- version
if: >-
github.ref == 'refs/heads/master' &&
vars.PAGES_REPO_NAME
+23
View File
@@ -0,0 +1,23 @@
Downloads
=========
Binaries
--------
- [ipxe.iso][iso] (Bootable ISO image)
- [ipxe.usb][usb] (Bootable USB or SD card image)
- [ipxeboot.tar.gz][netboot] (Network boot server files)
[iso]: ${BINURL}/ipxe.iso
[usb]: ${BINURL}/ipxe.usb
[netboot]: ${BINURL}/ipxeboot.tar.gz
Source code
-----------
- [${SRCNAME}.tar.gz][tarball]
[tarball]: ${SRCURL}.tar.gz
Changes
-------
+2
View File
@@ -57,6 +57,8 @@ GENKEYMAP := ./util/genkeymap.py
DOXYGEN := doxygen
LCAB := lcab
QEMUIMG := qemu-img
PANDOC := pandoc
ENVSUBST := envsubst
###############################################################################
#
+63 -5
View File
@@ -1094,11 +1094,6 @@ $(BIN)/NIC : $(AUTO_DEPS)
@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
CLEANUP += $(BIN)/NIC # Doesn't match the $(BIN)/*.* pattern
# Generate version number record
#
$(BIN)/version.txt : $(MAKEDEPS)
@$(ECHO) "$(VERSION)" > $@
# Analyse a target name (e.g. "bin/dfe538--prism2_pci.rom.tmp") and
# derive the variables:
#
@@ -1616,6 +1611,69 @@ $(BIN)/%.bxs : $(BIN)/%.tmp
endif # defined(BIN)
###############################################################################
#
# Versioning
#
ifdef BIN
REPOURL := https://github.com/ipxe/ipxe
ifeq ($(EXTRAVERSION),)
RELNAME := v$(firstword $(VERSION))
CLMARKER := [$(RELNAME)]
SRCNAME := ipxe-$(firstword $(VERSION))
SRCURL := $(REPOURL)/archive/$(RELNAME)
BINURL := $(REPOURL)/releases/download/$(RELNAME)
else
RELNAME :=
CLMARKER := [Unreleased]
SRCNAME := ipxe
SRCURL := $(REPOURL)/archive/$(GITVERSION)
BINURL := https://boot.ipxe.org
endif
# Generate version number record
#
$(BIN)/version.txt : $(MAKEDEPS)
$(QM)$(ECHO) " [VERSION] $@"
$(Q)$(ECHO) "$(VERSION)" > $@
# Generate release name
#
$(BIN)/relname.txt : $(MAKEDEPS)
$(QM)$(ECHO) " [RELNAME] $@"
$(Q)$(ECHO) "$(RELNAME)" > $@
# Generate changelog section
#
$(BIN)/changes.md : ../CHANGELOG.md $(MAKEDEPS)
$(QM)$(ECHO) " [CHANGES] $@"
$(Q)$(PANDOC) -f gfm -t gfm --columns 10000 $< | \
awk -v RS='\n\n## ' -v marker='$(CLMARKER)' \
'index ( $$0, marker ) == 1 { print }' > $@
$(Q)if [ ! -s $@ ] ; then \
echo "Missing $(CLMARKER) in $<" >&2 ; \
exit 1 ; \
fi
# Generate release title
#
$(BIN)/reltitle.txt : $(BIN)/changes.md $(MAKEDEPS)
$(QM)$(ECHO) " [RELTITLE] $@"
$(Q)head -1 $< | sed -E \
's/^\[(.*)\]\(.+\)\s+(.+)$$/\1 (\2)/; t; s/^\[(.*)\].*$$/\1/' > $@
# Generate release notes
#
$(BIN)/relnotes.md : ../RELNOTES.tmpl.md $(BIN)/changes.md $(MAKEDEPS)
$(QM)$(ECHO) " [RELNOTES] $@"
$(Q)( cat ../RELNOTES.tmpl.md ; tail -n +2 $(BIN)/changes.md ) | \
SRCNAME="$(SRCNAME)" SRCURL="$(SRCURL)" BINURL="$(BINURL)" \
$(ENVSUBST) '$$SRCNAME $$SRCURL $$BINURL' > $@
endif # defined(BIN)
###############################################################################
#
# Documentation