2021-09-29 18:41:12 +03:00
|
|
|
name: Release
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-03-14 08:59:59 +03:00
|
|
|
name: Build and upload artifacts
|
2022-06-25 09:50:29 +03:00
|
|
|
runs-on: ubuntu-latest
|
2023-01-20 18:25:15 +03:00
|
|
|
container: archlinux:latest
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
steps:
|
2022-06-25 09:50:29 +03:00
|
|
|
- name: Install dependencies
|
2023-07-13 05:57:38 +03:00
|
|
|
run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel git autoconf automake nasm curl mtools llvm clang lld mingw-w64-gcc
|
2022-06-25 09:50:29 +03:00
|
|
|
|
2021-02-23 01:36:21 +03:00
|
|
|
- name: Checkout code
|
2022-06-25 09:50:29 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-03-14 14:10:28 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: '0'
|
|
|
|
|
2022-06-25 09:50:29 +03:00
|
|
|
- name: Git config
|
|
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2021-03-14 14:10:28 +03:00
|
|
|
- name: Get tag name
|
|
|
|
run: echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Get branch name
|
2022-08-25 21:01:30 +03:00
|
|
|
run: echo "BRANCH_NAME=$(echo "$TAG_NAME" | grep -o 'v[0-9]\+\.')x-branch" >> $GITHUB_ENV
|
2021-03-14 14:10:28 +03:00
|
|
|
|
2022-01-16 08:09:36 +03:00
|
|
|
- name: Regenerate
|
2022-06-15 01:35:16 +03:00
|
|
|
run: ./bootstrap
|
2022-01-16 08:09:36 +03:00
|
|
|
|
|
|
|
- name: Create build dir
|
|
|
|
run: mkdir -p build
|
|
|
|
|
|
|
|
- name: Configure
|
2023-03-16 04:28:50 +03:00
|
|
|
run: cd build && ../configure --enable-all TOOLCHAIN_FOR_TARGET=llvm
|
2022-01-16 08:09:36 +03:00
|
|
|
|
2021-02-23 01:36:21 +03:00
|
|
|
- name: Build the bootloader
|
2022-01-16 08:09:36 +03:00
|
|
|
run: make -C build
|
2021-02-23 01:36:21 +03:00
|
|
|
|
2023-04-11 23:04:05 +03:00
|
|
|
- name: Clean limine
|
|
|
|
run: rm build/bin/limine
|
2022-07-13 18:17:12 +03:00
|
|
|
|
2023-04-11 23:04:05 +03:00
|
|
|
- name: Build limine for Windows
|
|
|
|
run: make -C build/bin CC="i686-w64-mingw32-gcc" CFLAGS="-O2 -pipe" CPPFLAGS="-D__USE_MINGW_ANSI_STDIO" limine
|
2023-02-07 01:58:19 +03:00
|
|
|
|
2023-04-11 23:04:05 +03:00
|
|
|
- name: Strip limine for Windows
|
|
|
|
run: i686-w64-mingw32-strip build/bin/limine.exe
|
2021-03-08 11:23:14 +03:00
|
|
|
|
2021-03-21 12:59:32 +03:00
|
|
|
- name: Copy LICENSE to bin
|
2023-10-28 04:44:32 +03:00
|
|
|
run: cp COPYING build/bin/LICENSE
|
2021-03-21 12:59:32 +03:00
|
|
|
|
2022-01-22 05:46:48 +03:00
|
|
|
- name: Copy install-sh to bin
|
2022-01-31 13:46:19 +03:00
|
|
|
run: cp build-aux/install-sh build/bin/
|
2022-01-22 05:46:48 +03:00
|
|
|
|
2022-04-13 02:01:47 +03:00
|
|
|
- name: Copy limine.h to bin
|
|
|
|
run: cp limine.h build/bin/
|
|
|
|
|
2023-06-15 02:47:16 +03:00
|
|
|
- name: Remove limine-bios-hdd.bin
|
|
|
|
run: rm build/bin/limine-bios-hdd.bin
|
2022-03-30 16:22:35 +03:00
|
|
|
|
2021-03-14 08:59:59 +03:00
|
|
|
- name: Push binaries to binary branch
|
2021-03-14 14:10:28 +03:00
|
|
|
run: |
|
|
|
|
git config user.name 'mintsuki'
|
|
|
|
git config user.email 'mintsuki@users.noreply.github.com'
|
2022-06-25 09:50:29 +03:00
|
|
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/limine-bootloader/limine.git
|
2021-03-15 08:42:37 +03:00
|
|
|
git fetch --all
|
|
|
|
git checkout $BRANCH_NAME-binary || git checkout --orphan $BRANCH_NAME-binary
|
2021-11-20 10:52:15 +03:00
|
|
|
rm -rf $(ls -a | grep -v '^\.git$' | grep -v '^\.\.$' | grep -v '^\.$' | grep -v '^build$')
|
|
|
|
cp -r build/bin/. ./
|
|
|
|
rm -rf build
|
2022-03-26 04:30:05 +03:00
|
|
|
git add -f .
|
2021-03-14 14:10:28 +03:00
|
|
|
git commit -m "Binary release $TAG_NAME"
|
|
|
|
git push origin $BRANCH_NAME-binary
|
2021-03-14 15:11:55 +03:00
|
|
|
git tag $TAG_NAME-binary
|
|
|
|
git push origin $BRANCH_NAME-binary --tags
|
|
|
|
|
2021-07-01 00:17:16 +03:00
|
|
|
- name: Cleanup source tree
|
|
|
|
run: git checkout $TAG_NAME && rm -rf * && git checkout .
|
|
|
|
|
|
|
|
- name: Package release tarball
|
2022-06-15 06:01:22 +03:00
|
|
|
run: ./bootstrap && ./configure --enable-all && make dist
|
2021-07-01 00:17:16 +03:00
|
|
|
|
2021-03-14 15:11:55 +03:00
|
|
|
- name: Create release notes
|
|
|
|
run: echo "Binary release can be found at https://github.com/limine-bootloader/limine/tree/$TAG_NAME-binary" > rel_notes.txt
|
2021-03-14 14:10:28 +03:00
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
2021-03-14 15:11:55 +03:00
|
|
|
with:
|
|
|
|
body_path: rel_notes.txt
|
2021-07-01 00:17:16 +03:00
|
|
|
files: |
|
2022-01-28 12:23:26 +03:00
|
|
|
limine-*.tar.*
|
2021-03-14 14:10:28 +03:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|