.github/workflows/buildtools.yml #490
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
permissions: | |
contents: write | |
jobs: | |
build_cross_tools: | |
strategy: | |
fail-fast: false | |
matrix: | |
haiku_arch: [x86_64, x86_gcc2, arm64, riscv64] | |
include: | |
- haiku_arch: x86_gcc2 | |
haiku_secondary_arch: x86 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check latest Haiku buildtools btrev | |
id: get_btrev | |
run: | | |
echo "btrev=btrev$(git ls-remote --tags https://review.haiku-os.org/buildtools "btrev*" | sed -e 's:.*refs/tags/btrev::g' | sort -nr | head -n1)" >> "$GITHUB_OUTPUT" | |
- name: Check latest buildtools release | |
id: get_buildtools | |
run: | | |
echo "btrev=$($GITHUB_WORKSPACE/fetch.sh --buildtools --arch=${{ matrix.haiku_arch }} --repository=${{ github.repository }} --rev-only)" >> "$GITHUB_OUTPUT" | |
- name: Build buildtools | |
if: steps.get_btrev.outputs.btrev != steps.get_buildtools.outputs.btrev && !matrix.haiku_secondary_arch | |
run: | | |
echo "Building buildtools at ${{ steps.get_btrev.outputs.btrev }}" | |
git clone https://review.haiku-os.org/haiku --depth 1 | |
git clone https://review.haiku-os.org/buildtools --depth 1 | |
sudo apt update | |
sudo apt install -y git nasm bc autoconf automake texinfo flex bison \ | |
gawk build-essential unzip wget zip less zlib1g-dev libzstd-dev \ | |
xorriso libtool python3 attr | |
cd haiku | |
mkdir generated.${{ matrix.haiku_arch }}; cd generated.${{ matrix.haiku_arch }} | |
../configure --cross-tools-source ../../buildtools --build-cross-tools ${{ matrix.haiku_arch }} -j$(nproc) | |
zip -r $GITHUB_WORKSPACE/x86_64-linux-buildtools-${{ matrix.haiku_arch }}-${{ steps.get_btrev.outputs.btrev }}.zip cross-tools-${{ matrix.haiku_arch }} | |
- name: Build hybrid buildtools | |
if: steps.get_btrev.outputs.btrev != steps.get_buildtools.outputs.btrev && matrix.haiku_secondary_arch | |
run: | | |
echo "Building hybrid buildtools at ${{ steps.get_btrev.outputs.btrev }}" | |
git clone https://review.haiku-os.org/haiku --depth 1 | |
git clone https://review.haiku-os.org/buildtools --depth 1 | |
sudo apt update | |
sudo apt install -y git nasm bc autoconf automake texinfo flex bison \ | |
gawk build-essential unzip wget zip less zlib1g-dev libzstd-dev \ | |
xorriso libtool python3 attr gcc-multilib | |
cd haiku | |
mkdir generated.${{ matrix.haiku_arch }}; cd generated.${{ matrix.haiku_arch }} | |
../configure --cross-tools-source ../../buildtools --build-cross-tools ${{ matrix.haiku_arch }} --build-cross-tools ${{ matrix.haiku_secondary_arch }} -j$(nproc) | |
zip -r $GITHUB_WORKSPACE/x86_64-linux-buildtools-${{ matrix.haiku_arch }}-${{ steps.get_btrev.outputs.btrev }}.zip cross-tools-* | |
- name: Upload artifacts | |
if: steps.get_btrev.outputs.btrev != steps.get_buildtools.outputs.btrev | |
uses: actions/upload-artifact@v3 | |
with: | |
name: x86_64-linux-buildtools-${{ matrix.haiku_arch }}-${{ steps.get_btrev.outputs.btrev }} | |
path: x86_64-linux-buildtools-${{ matrix.haiku_arch }}-${{ steps.get_btrev.outputs.btrev }}.zip | |
- name: Create release | |
if: steps.get_btrev.outputs.btrev != steps.get_buildtools.outputs.btrev | |
id: create-release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: buildtools-${{ matrix.haiku_arch }}-${{ steps.get_btrev.outputs.btrev }} | |
prerelease: false | |
title: Cross compiler for ${{ matrix.haiku_arch }} Haiku ${{ steps.get_btrev.outputs.btrev }} | |
files: x86_64-linux-buildtools-${{ matrix.haiku_arch }}-${{ steps.get_btrev.outputs.btrev }}.zip |