-
Notifications
You must be signed in to change notification settings - Fork 190
98 lines (78 loc) · 3.22 KB
/
binary-release.yml
File metadata and controls
98 lines (78 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Binary release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (e.g. v11.3.1)'
required: true
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 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
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
- 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
- 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: 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
- 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: Push binaries to binary branch
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