mirror of
https://github.com/ipxe/ipxe
synced 2026-05-09 18:00:12 +03:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
-------
|
||||
@@ -57,6 +57,8 @@ GENKEYMAP := ./util/genkeymap.py
|
||||
DOXYGEN := doxygen
|
||||
LCAB := lcab
|
||||
QEMUIMG := qemu-img
|
||||
PANDOC := pandoc
|
||||
ENVSUBST := envsubst
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user