2021-02-23 01:36:21 +03:00
|
|
|
name: Limine
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-03-14 08:59:59 +03:00
|
|
|
name: Build and upload artifacts
|
2021-03-14 14:10:28 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-03-14 14:10:28 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: '0'
|
|
|
|
|
|
|
|
- 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]\+\.[0-9]\+')-branch" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: sudo apt-get update && sudo apt-get install git build-essential nasm gcc-mingw-w64 gcc-multilib wget -y
|
2021-02-23 01:36:21 +03:00
|
|
|
|
2021-03-08 11:23:14 +03:00
|
|
|
- name: Build the toolchain (BIOS)
|
2021-03-14 14:10:28 +03:00
|
|
|
run: make toolchain-bios
|
2021-02-23 01:36:21 +03:00
|
|
|
|
2021-03-08 11:23:14 +03:00
|
|
|
- name: Build the toolchain (UEFI)
|
2021-03-14 14:10:28 +03:00
|
|
|
run: make toolchain-uefi
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
- name: Build the bootloader
|
2021-03-14 14:10:28 +03:00
|
|
|
run: make
|
2021-02-23 01:36:21 +03:00
|
|
|
|
2021-03-10 02:55:08 +03:00
|
|
|
- name: Remove limine-hdd.o
|
2021-03-14 14:10:28 +03:00
|
|
|
run: rm limine-hdd.o
|
2021-03-10 02:55:08 +03:00
|
|
|
|
2021-02-23 01:36:21 +03:00
|
|
|
- name: Build limine-install-linux-x86_64
|
2021-03-14 14:10:28 +03:00
|
|
|
run: make CFLAGS="-O2 -pipe -static" bin/limine-install
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
- name: Strip limine-install-linux-x86_64
|
2021-03-14 14:10:28 +03:00
|
|
|
run: strip bin/limine-install
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
- name: Rename limine-install-linux-x86_64
|
2021-03-14 14:10:28 +03:00
|
|
|
run: mv bin/limine-install bin/limine-install-linux-x86_64
|
2021-03-08 11:23:14 +03:00
|
|
|
|
|
|
|
- name: Remove limine-hdd.o
|
2021-03-14 14:10:28 +03:00
|
|
|
run: rm limine-hdd.o
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
- name: Build limine-install-linux-x86_32
|
2021-03-14 14:10:28 +03:00
|
|
|
run: make OBJCOPY_ARCH="elf32-i386" CC="gcc -m32" CFLAGS="-O2 -pipe -static" bin/limine-install
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
- name: Strip limine-install-linux-x86_32
|
2021-03-14 14:10:28 +03:00
|
|
|
run: strip bin/limine-install
|
2021-02-23 01:36:21 +03:00
|
|
|
|
|
|
|
- name: Rename limine-install-linux-x86_32
|
2021-03-14 14:10:28 +03:00
|
|
|
run: mv bin/limine-install bin/limine-install-linux-x86_32
|
2021-03-08 11:23:14 +03:00
|
|
|
|
|
|
|
- name: Remove limine-hdd.o
|
2021-03-14 14:10:28 +03:00
|
|
|
run: rm limine-hdd.o
|
2021-03-08 11:23:14 +03:00
|
|
|
|
2021-03-14 14:10:28 +03:00
|
|
|
- name: Build limine-install-win32
|
|
|
|
run: make CC="i686-w64-mingw32-gcc" OBJCOPY="i686-w64-mingw32-objcopy" CFLAGS="-O2 -pipe" bin/limine-install
|
|
|
|
|
|
|
|
- name: Strip limine-install-win32
|
|
|
|
run: i686-w64-mingw32-strip bin/limine-install.exe
|
2021-03-08 11:23:14 +03:00
|
|
|
|
2021-03-14 08:59:59 +03:00
|
|
|
- name: Rename limine-install-win32
|
2021-03-14 14:10:28 +03:00
|
|
|
run: mv bin/limine-install.exe bin/limine-install-win32.exe
|
2021-03-08 11:23:14 +03:00
|
|
|
|
2021-03-10 02:55:08 +03:00
|
|
|
- name: Remove bin/limine-hdd.bin
|
2021-03-14 14:10:28 +03:00
|
|
|
run: rm bin/limine-hdd.bin
|
2021-03-10 02:55:08 +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'
|
|
|
|
git checkout --orphan $BRANCH_NAME-binary || git checkout $BRANCH_NAME-binary
|
|
|
|
rm -rf $(ls -a | grep -v '^\.git$' | grep -v '^\.\.$' | grep -v '^\.$' | grep -v '^bin$')
|
|
|
|
mv bin/* ./
|
|
|
|
rm -rf bin
|
|
|
|
git add .
|
|
|
|
git commit -m "Binary release $TAG_NAME"
|
|
|
|
git push origin $BRANCH_NAME-binary
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|