:: commit 1f215927cf1d1e1683f3c59bd3b10ef35218fa1f

Mintsuki <mintsuki@protonmail.com> — 2026-04-25 20:42

parents: 3464a9c542

gha: Combine release and binary-release workflows and fix related bugs

diff --git a/.github/workflows/binary-release.yml b/.github/workflows/binary-release.yml
deleted file mode 100644
index 8760c177..00000000
--- a/.github/workflows/binary-release.yml
+++ /dev/null
@@ -1,95 +0,0 @@
-name: Binary release
-
-on:
-  push:
-    tags:
-      - 'v*'
-
-jobs:
-  build:
-    name: Build and upload binary artifacts
-    runs-on: ubuntu-latest
-    container: archlinux:latest
-
-    steps:
-      - name: Install dependencies
-        run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel gnupg gzip xz zip git autoconf automake nasm curl mtools llvm clang lld
-
-      - name: Import GPG public key
-        run: gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 05D29860D0A0668AAEFB9D691F3C021BECA23821
-
-      - name: Import GPG private key
-        run: echo "$MINTSUKI_PRIVATE_KEY" | gpg --batch --import
-        env:
-          MINTSUKI_PRIVATE_KEY: ${{ secrets.MINTSUKI_PRIVATE_KEY }}
-
-      - name: Checkout code
-        uses: actions/checkout@v6
-
-      - name: Git config
-        run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
-
-      - name: Get tag name
-        run: echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
-
-      - name: Regenerate
-        run: ./bootstrap
-
-      - name: Create build dir
-        run: mkdir -p build
-
-      - name: Configure
-        run: cd build && ../configure --enable-all
-
-      - name: Build the bootloader
-        run: make -C build -j$(nproc)
-
-      - name: Clean limine
-        run: rm build/bin/limine
-
-      - name: Fetch MinGW
-        run: |
-          set -e
-          curl -Lo /tmp/mingw-i486.tar.xz https://github.com/osdev0/mingw-binary-builds/releases/latest/download/mingw-i486.tar.xz
-          cd /tmp
-          tar -xf mingw-i486.tar.xz
-
-      - name: Build limine for Windows
-        run: |
-          set -e
-          make -C build/bin CC="/tmp/mingw-i486/bin/i486-w64-mingw32-gcc" CFLAGS="-O2 -pipe" CPPFLAGS="-D__USE_MINGW_ANSI_STDIO" limine
-          /tmp/mingw-i486/bin/i486-w64-mingw32-strip build/bin/limine.exe
-          mkdir build/bin/limine-tool-windows-x86
-          mv build/bin/limine.exe build/bin/limine-tool-windows-x86/
-
-      - name: Copy LICENSE to bin
-        run: cp COPYING build/bin/LICENSE
-
-      - name: Remove limine-bios-hdd.bin
-        run: rm build/bin/limine-bios-hdd.bin
-
-      - name: Create binary release zip and tarballs
-        run: |
-          set -e
-          TARBALL_DIRNAME=$(echo ${TAG_NAME} | sed 's/^v//g')
-          mv build/bin ./limine-binary-${TARBALL_DIRNAME}
-          zip -r limine-binary-${TARBALL_DIRNAME}.zip limine-binary-${TARBALL_DIRNAME}
-          tar -cvf limine-binary-${TARBALL_DIRNAME}.tar limine-binary-${TARBALL_DIRNAME}
-          gzip < limine-binary-${TARBALL_DIRNAME}.tar > limine-binary-${TARBALL_DIRNAME}.tar.gz
-          xz < limine-binary-${TARBALL_DIRNAME}.tar > limine-binary-${TARBALL_DIRNAME}.tar.xz
-          rm limine-binary-${TARBALL_DIRNAME}.tar
-
-      - name: Sign release tarball
-        run: |
-          set -e
-          for f in limine-binary-*.*; do \
-            gpg --batch --default-key 05D29860D0A0668AAEFB9D691F3C021BECA23821 --detach-sign $f; \
-          done
-
-      - name: Add binary tarball to the release
-        uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
-        with:
-          files: |
-            limine-binary-*.*
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 7c5bc971..8002f9bc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,16 +4,22 @@ on:
   push:
     tags:
       - 'v*'
+  workflow_dispatch:
+    inputs:
+      tag:
+        description: 'Tag to build (e.g. v12.0.0)'
+        required: true
+        type: string
 
 jobs:
   build:
-    name: Build and upload release tarball
+    name: Build and upload release artifacts
     runs-on: ubuntu-latest
     container: archlinux:latest
 
     steps:
       - name: Install dependencies
-        run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel gnupg gzip bzip2 xz git autoconf automake nasm curl mtools llvm clang lld
+        run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel gnupg gzip bzip2 xz zip git autoconf automake nasm curl mtools llvm clang lld
 
       - name: Import GPG public key
         run: gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 05D29860D0A0668AAEFB9D691F3C021BECA23821
@@ -25,25 +31,74 @@ jobs:
 
       - name: Checkout code
         uses: actions/checkout@v6
+        with:
+          ref: ${{ inputs.tag || github.ref }}
 
       - name: Git config
         run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
 
       - name: Get tag name
-        run: echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
+        run: |
+          if [ -n "${{ inputs.tag }}" ]; then
+            echo "TAG_NAME=${{ inputs.tag }}" >> $GITHUB_ENV
+          else
+            echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
+          fi
+
+      - name: Regenerate
+        run: ./bootstrap
+
+      - name: Create build dir
+        run: mkdir -p build
+
+      - name: Configure
+        run: cd build && ../configure --enable-all
+
+      - name: Package source release tarball
+        run: |
+          make -C build dist
+          mv build/limine-*.tar.* ./
+
+      - name: Build the bootloader
+        run: make -C build -j$(nproc)
+
+      - name: Clean limine
+        run: rm build/bin/limine
+
+      - name: Fetch MinGW
+        run: |
+          curl -Lo /tmp/mingw-i486.tar.xz https://github.com/osdev0/mingw-binary-builds/releases/latest/download/mingw-i486.tar.xz
+          cd /tmp
+          tar -xf mingw-i486.tar.xz
+
+      - name: Build limine for Windows
+        run: |
+          make -C build/bin CC="/tmp/mingw-i486/bin/i486-w64-mingw32-gcc" CFLAGS="-O2 -pipe" CPPFLAGS="-D__USE_MINGW_ANSI_STDIO" limine
+          /tmp/mingw-i486/bin/i486-w64-mingw32-strip build/bin/limine.exe
+          mkdir build/bin/limine-tool-windows-x86
+          mv build/bin/limine.exe build/bin/limine-tool-windows-x86/
+
+      - name: Copy LICENSE to bin
+        run: cp COPYING build/bin/LICENSE
+
+      - name: Remove limine-bios-hdd.bin
+        run: rm build/bin/limine-bios-hdd.bin
 
-      - name: Package release tarball
+      - name: Create binary release zip and tarballs
         run: |
-          set -e
-          ./bootstrap
-          ./configure
-          make dist
+          TARBALL_DIRNAME=$(echo ${TAG_NAME} | sed 's/^v//g')
+          mv build/bin ./limine-binary-${TARBALL_DIRNAME}
+          zip -r limine-binary-${TARBALL_DIRNAME}.zip limine-binary-${TARBALL_DIRNAME}
+          tar -cvf limine-binary-${TARBALL_DIRNAME}.tar limine-binary-${TARBALL_DIRNAME}
+          gzip < limine-binary-${TARBALL_DIRNAME}.tar > limine-binary-${TARBALL_DIRNAME}.tar.gz
+          xz < limine-binary-${TARBALL_DIRNAME}.tar > limine-binary-${TARBALL_DIRNAME}.tar.xz
+          rm limine-binary-${TARBALL_DIRNAME}.tar
+          rm -rf limine-binary-${TARBALL_DIRNAME}
 
-      - name: Sign release tarball
+      - name: Sign release tarballs
         run: |
-          set -e
-          for f in limine-*.tar.*; do \
-            gpg --batch --default-key 05D29860D0A0668AAEFB9D691F3C021BECA23821 --detach-sign $f; \
+          for f in limine-*.tar.* limine-binary-*.zip; do
+            gpg --batch --default-key 05D29860D0A0668AAEFB9D691F3C021BECA23821 --detach-sign "$f"
           done
 
       - name: Create release notes
@@ -69,8 +124,10 @@ jobs:
       - name: Release
         uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
         with:
+          tag_name: ${{ env.TAG_NAME }}
           body_path: rel_notes.txt
           files: |
             limine-*.tar.*
+            limine-binary-*.zip*
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tab: 248 wrap: offon