gha: Ship binary releases as tarballs in release assets
Previously, we used a separate git branch for this.
diff --git a/.github/workflows/binary-release.yml b/.github/workflows/binary-release.yml
index b522d074..8760c177 100644
--- a/.github/workflows/binary-release.yml
+++ b/.github/workflows/binary-release.yml
@@ -4,11 +4,6 @@ on:
push:
tags:
- 'v*'
- workflow_dispatch:
- inputs:
- tag:
- description: 'Tag to build (e.g. v11.3.1)'
- required: true
jobs:
build:
@@ -18,7 +13,7 @@ jobs:
steps:
- name: Install dependencies
- run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel gnupg git autoconf automake nasm curl mtools llvm clang lld
+ 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
@@ -30,24 +25,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6
- with:
- fetch-depth: '0'
- ref: ${{ inputs.tag || github.ref }}
- name: Git config
- run: |
- set -e
- git config --global --add safe.directory "$GITHUB_WORKSPACE"
- git config --global user.name 'Mintsuki'
- git config --global user.email 'mintsuki@protonmail.com'
- git config --global user.signingkey 05D29860D0A0668AAEFB9D691F3C021BECA23821
+ 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: Get branch name
- run: echo "BRANCH_NAME=$(echo "$TAG_NAME" | grep -o 'v[0-9]\+\.')x" >> $GITHUB_ENV
-
- name: Regenerate
run: ./bootstrap
@@ -71,10 +55,12 @@ jobs:
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
-
- - name: Strip limine for Windows
- run: /tmp/mingw-i486/bin/i486-w64-mingw32-strip build/bin/limine.exe
+ 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
@@ -82,17 +68,28 @@ jobs:
- name: Remove limine-bios-hdd.bin
run: rm build/bin/limine-bios-hdd.bin
- - name: Push binaries to binary branch
+ - 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
- git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/Limine-Bootloader/Limine.git
- git fetch --all
- git checkout $BRANCH_NAME-binary || git checkout --orphan $BRANCH_NAME-binary
- rm -rf $(ls -a | grep -v '^\.git$' | grep -v '^\.\.$' | grep -v '^\.$' | grep -v '^build$')
- cp -r build/bin/. ./
- rm -rf build
- git add -f .
- git commit -m "Binary release $TAG_NAME" -S
- git push origin $BRANCH_NAME-binary
- git tag $TAG_NAME-binary -s -m $TAG_NAME-binary
- git push origin $TAG_NAME-binary
+ 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 5aee5c46..7c5bc971 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -25,8 +25,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6
- with:
- fetch-depth: '0'
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
@@ -52,8 +50,6 @@ jobs:
run: |
cat <<EOF >rel_notes.txt
Changelog can be found [here](https://github.com/Limine-Bootloader/Limine/blob/$TAG_NAME/ChangeLog).
-
- Binary release can be found [here](https://github.com/Limine-Bootloader/Limine/tree/$TAG_NAME-binary).
EOF
cat <<'EOF' >>rel_notes.txt
diff --git a/README.md b/README.md
index bbfac08d..8d04b65d 100644
--- a/README.md
+++ b/README.md
@@ -69,27 +69,21 @@ All Limine releases since 7.x use [Semantic Versioning](https://semver.org/spec/
## Binary releases
For convenience, for point releases, binaries are distributed. These binaries
-are shipped in the `-binary` branches and tags of this repository
-(see [branches](https://github.com/Limine-Bootloader/Limine/branches/all) and
-[tags](https://github.com/Limine-Bootloader/Limine/tags)).
+are shipped as assets as part of the
+[Limine GitHub releases](https://github.com/Limine-Bootloader/Limine/releases)
+(see the `limine-binary-*` files).
-For example, to clone the latest binary release of the `11.x` branch, one can do:
-```bash
-git clone https://github.com/Limine-Bootloader/Limine.git --branch=v11.x-binary --depth=1
-```
-or, to clone a specific binary point release (for example `11.3.1`):
-```bash
-git clone https://github.com/Limine-Bootloader/Limine.git --branch=v11.3.1-binary --depth=1
-```
+The `limine` host tool is shipped in highly portable source form as part of the
+binary release package. For most/all UNIX-like OSes, in order to rebuild it,
+simply run `make` in the unpacked binary release directory. Alternatively, it
+can be built stand-alone using any C99 compatible compiler.
-In order to rebuild host utilities like `limine`, simply run `make` in the binary
-release directory.
-
-Host utility binaries are provided for Windows.
+`limine` host tool binaries for x86 Windows are provided as part of the binary
+release package.
## Build and Install Instructions
-*The following steps are not necessary if cloning a binary release.*
+*The following steps are not necessary if using a binary release.*
See [INSTALL.md](INSTALL.md).
