[ci] Add a job to automatically create releases

Add a job that will automatically create a (draft) release for any
suitable tag, using the build artifacts and release notes already
constructed by earlier jobs.  Minimise the logic within the release
job itself, since by definition it cannot be tested on every commit.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2026-02-20 15:14:42 +00:00
parent 179366d729
commit 0854850d02

View File

@ -522,7 +522,8 @@ jobs:
- name: Build
working-directory: src
run: |
make ${{ env.bindir }}/version.txt \
make REPOURL=${{ github.server_url }}/${{ github.repository }} \
${{ env.bindir }}/version.txt \
${{ env.bindir }}/relname.txt \
${{ env.bindir }}/reltitle.txt \
${{ env.bindir }}/relnotes.md
@ -579,3 +580,43 @@ jobs:
run: |
gh workflow run build.yml -f run_id=${{ github.run_id }}
echo "Results at ${{ env.workflow_url }}"
release:
name: Release
runs-on: ubuntu-latest
needs:
- bios
- sbi
- uefi
- sbsign
- linux
- shim
- combine
- netboot
- version
if: >-
startsWith ( github.ref, 'refs/tags/v' )
steps:
- name: Download
uses: actions/download-artifact@v7
with:
pattern: "{bin-combi,netboot,version}"
- name: Tag check
run: |
RELNAME=$(cat version/relname.txt)
if [ "${{ github.ref_name }}" != "${RELNAME}" ] ; then
echo "ERROR: Tag does not match release name ${RELNAME}" >&2
exit 1
fi
- name: Release
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" --verify-tag --draft \
--title "$(cat version/relname.txt)" \
--notes-file version/relnotes.md \
bin-combi/ipxe.iso bin-combi/ipxe.usb netboot/ipxeboot.tar.gz