gh: Update gh workflow
This commit is contained in:
parent
503fb92c90
commit
91e4e65110
96
.github/workflows/main.yml
vendored
96
.github/workflows/main.yml
vendored
@ -8,88 +8,84 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and upload artifacts
|
name: Build and upload artifacts
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
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
|
||||||
|
|
||||||
- name: Build the toolchain (BIOS)
|
- name: Build the toolchain (BIOS)
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: make toolchain-bios
|
||||||
with:
|
|
||||||
command: make toolchain-bios
|
|
||||||
|
|
||||||
- name: Build the toolchain (UEFI)
|
- name: Build the toolchain (UEFI)
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: make toolchain-uefi
|
||||||
with:
|
|
||||||
command: make toolchain-uefi
|
|
||||||
|
|
||||||
- name: Build the bootloader
|
- name: Build the bootloader
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: make
|
||||||
with:
|
|
||||||
command: apt-get update && apt-get install nasm -y && make
|
|
||||||
|
|
||||||
- name: Remove limine-hdd.o
|
- name: Remove limine-hdd.o
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: rm limine-hdd.o
|
||||||
with:
|
|
||||||
command: rm limine-hdd.o
|
|
||||||
|
|
||||||
- name: Build limine-install-linux-x86_64
|
- name: Build limine-install-linux-x86_64
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: make CFLAGS="-O2 -pipe -static" bin/limine-install
|
||||||
with:
|
|
||||||
command: make CFLAGS="-O2 -pipe -static" bin/limine-install
|
|
||||||
|
|
||||||
- name: Strip limine-install-linux-x86_64
|
- name: Strip limine-install-linux-x86_64
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: strip bin/limine-install
|
||||||
with:
|
|
||||||
command: strip bin/limine-install
|
|
||||||
|
|
||||||
- name: Rename limine-install-linux-x86_64
|
- name: Rename limine-install-linux-x86_64
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: mv bin/limine-install bin/limine-install-linux-x86_64
|
||||||
with:
|
|
||||||
command: mv bin/limine-install bin/limine-install-linux-x86_64
|
|
||||||
|
|
||||||
- name: Remove limine-hdd.o
|
- name: Remove limine-hdd.o
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: rm limine-hdd.o
|
||||||
with:
|
|
||||||
command: rm limine-hdd.o
|
|
||||||
|
|
||||||
- name: Build limine-install-linux-x86_32
|
- name: Build limine-install-linux-x86_32
|
||||||
uses: mintsuki-org/debian-i386@v0.3
|
run: make OBJCOPY_ARCH="elf32-i386" CC="gcc -m32" CFLAGS="-O2 -pipe -static" bin/limine-install
|
||||||
with:
|
|
||||||
command: make CFLAGS="-O2 -pipe -static" bin/limine-install
|
|
||||||
|
|
||||||
- name: Strip limine-install-linux-x86_32
|
- name: Strip limine-install-linux-x86_32
|
||||||
uses: mintsuki-org/debian-i386@v0.3
|
run: strip bin/limine-install
|
||||||
with:
|
|
||||||
command: strip bin/limine-install
|
|
||||||
|
|
||||||
- name: Rename limine-install-linux-x86_32
|
- name: Rename limine-install-linux-x86_32
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: mv bin/limine-install bin/limine-install-linux-x86_32
|
||||||
with:
|
|
||||||
command: mv bin/limine-install bin/limine-install-linux-x86_32
|
|
||||||
|
|
||||||
- name: Remove limine-hdd.o
|
- name: Remove limine-hdd.o
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: rm limine-hdd.o
|
||||||
with:
|
|
||||||
command: rm limine-hdd.o
|
|
||||||
|
|
||||||
- name: Build and strip limine-install-win32
|
- name: Build limine-install-win32
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: make CC="i686-w64-mingw32-gcc" OBJCOPY="i686-w64-mingw32-objcopy" CFLAGS="-O2 -pipe" bin/limine-install
|
||||||
with:
|
|
||||||
command: apt-get update && apt-get install gcc-mingw-w64 -y && make CC="i686-w64-mingw32-gcc" OBJCOPY="i686-w64-mingw32-objcopy" CFLAGS="-O2 -pipe" bin/limine-install && i686-w64-mingw32-strip bin/limine-install.exe
|
- name: Strip limine-install-win32
|
||||||
|
run: i686-w64-mingw32-strip bin/limine-install.exe
|
||||||
|
|
||||||
- name: Rename limine-install-win32
|
- name: Rename limine-install-win32
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: mv bin/limine-install.exe bin/limine-install-win32.exe
|
||||||
with:
|
|
||||||
command: mv bin/limine-install.exe bin/limine-install-win32.exe
|
|
||||||
|
|
||||||
- name: Remove bin/limine-hdd.bin
|
- name: Remove bin/limine-hdd.bin
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: rm bin/limine-hdd.bin
|
||||||
with:
|
|
||||||
command: rm bin/limine-hdd.bin
|
|
||||||
|
|
||||||
- name: Push binaries to binary branch
|
- name: Push binaries to binary branch
|
||||||
uses: mintsuki-org/debian-x86_64@v0.3
|
run: |
|
||||||
with:
|
git config user.name 'mintsuki'
|
||||||
command: git checkout --orphan `git branch --show-current`-binary || git checkout `git branch --show-current`-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 ${GITHUB_REF##*/}" && git push origin `git branch --show-current`-binary
|
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 }}
|
||||||
|
3
Makefile
3
Makefile
@ -1,5 +1,6 @@
|
|||||||
CC = cc
|
CC = cc
|
||||||
OBJCOPY = objcopy
|
OBJCOPY = objcopy
|
||||||
|
OBJCOPY_ARCH = default
|
||||||
CFLAGS = -O2 -pipe -Wall -Wextra
|
CFLAGS = -O2 -pipe -Wall -Wextra
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
DESTDIR =
|
DESTDIR =
|
||||||
@ -17,7 +18,7 @@ bin/limine-install: limine-install.c limine-hdd.o
|
|||||||
$(CC) $(CFLAGS) -std=c11 limine-hdd.o limine-install.c -o $@
|
$(CC) $(CFLAGS) -std=c11 limine-hdd.o limine-install.c -o $@
|
||||||
|
|
||||||
limine-hdd.o: bin/limine-hdd.bin
|
limine-hdd.o: bin/limine-hdd.bin
|
||||||
$(OBJCOPY) -B i8086 -I binary -O default bin/limine-hdd.bin $@
|
$(OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) bin/limine-hdd.bin $@
|
||||||
|
|
||||||
clean: limine-bios-clean limine-uefi-clean
|
clean: limine-bios-clean limine-uefi-clean
|
||||||
rm -f limine-hdd.o
|
rm -f limine-hdd.o
|
||||||
|
Loading…
Reference in New Issue
Block a user