rulimine/.github/workflows/release.yml

113 lines
3.5 KiB
YAML
Raw Normal View History

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
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-branch" >> $GITHUB_ENV
2021-03-14 14:10:28 +03:00
- name: Install dependencies
2022-01-22 06:10:48 +03:00
run: sudo apt-get update && sudo apt-get install git build-essential autoconf automake nasm gcc-mingw-w64 gcc-multilib curl mtools -y
2021-02-23 01:36:21 +03:00
2022-01-21 05:27:02 +03:00
- name: Build the toolchain
run: ./make_toolchain.sh
2022-01-16 08:09:36 +03:00
- name: Regenerate
run: NOCONFIGURE=yes ./autogen.sh
- name: Create build dir
run: mkdir -p build
- name: Configure
run: cd build && ../configure
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
- name: Clean limine-install
2022-01-16 08:09:36 +03:00
run: rm build/bin/limine-install
2021-02-23 01:36:21 +03:00
- name: Build limine-install-linux-x86_64
2022-01-16 08:09:36 +03:00
run: make -C build CFLAGS="-O2 -pipe -static" limine-install
2021-02-23 01:36:21 +03:00
- name: Strip limine-install-linux-x86_64
run: strip build/bin/limine-install
2021-02-23 01:36:21 +03:00
- name: Rename limine-install-linux-x86_64
run: mv build/bin/limine-install build/bin/limine-install-linux-x86_64
2021-03-08 11:23:14 +03:00
2021-02-23 01:36:21 +03:00
- name: Build limine-install-linux-x86_32
2022-01-16 08:09:36 +03:00
run: make -C build CC="gcc -m32" CFLAGS="-O2 -pipe -static" limine-install
2021-02-23 01:36:21 +03:00
- name: Strip limine-install-linux-x86_32
run: strip build/bin/limine-install
2021-02-23 01:36:21 +03:00
- name: Rename limine-install-linux-x86_32
run: mv build/bin/limine-install build/bin/limine-install-linux-x86_32
2021-03-08 11:23:14 +03:00
2021-03-14 14:10:28 +03:00
- name: Build limine-install-win32
2022-01-16 08:09:36 +03:00
run: make -C build CC="i686-w64-mingw32-gcc" CFLAGS="-O2 -pipe" limine-install
2021-03-14 14:10:28 +03:00
- name: Strip limine-install-win32
run: i686-w64-mingw32-strip build/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
run: mv build/bin/limine-install.exe build/bin/limine-install-win32.exe
2021-03-08 11:23:14 +03:00
- name: Copy LICENSE to bin
run: cp LICENSE.md build/bin/
2022-01-22 05:46:48 +03:00
- name: Copy install-sh to bin
run: cp install-sh build/bin/
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'
2021-03-15 08:42:37 +03:00
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
2021-03-14 14:10:28 +03:00
git add .
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
git checkout latest-binary
git rebase $BRANCH_NAME-binary && git push origin latest-binary
2021-03-14 15:11:55 +03:00
- name: Cleanup source tree
run: git checkout $TAG_NAME && rm -rf * && git checkout .
- name: Package release tarball
2022-01-16 08:09:36 +03:00
run: ./autogen.sh && make dist
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
files: |
limine-*.tar.xz
2021-03-14 14:10:28 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}