]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ci] Add a job to automatically create releases
authorMichael Brown <mcb30@ipxe.org>
Fri, 20 Feb 2026 15:14:42 +0000 (15:14 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sat, 21 Feb 2026 00:29:50 +0000 (00:29 +0000)
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>
.github/workflows/build.yml

index d175be7f4fdbf503feab2e88dfc63d63402d2079..1cd1376aef9bc413a22d7fd3b0ea2e7feaca4db2 100644 (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