-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e0d9cf
commit c26f0b8
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
HAIKU_ARCH: x86_64 | ||
|
||
jobs: | ||
build_cross_tools: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check latest Haiku buildtools btrev | ||
id: get_btrev | ||
run: | | ||
echo "btrev=$(curl -s https://git.haiku-os.org/buildtools/refs/tags | sed -n 's/^.*>\(btrev[^<]*\).*$/\1/p' | head -n 1)" >> "$GITHUB_OUTPUT" | ||
- name: Check latest buildtools release | ||
id: get_buildtools | ||
run: | | ||
echo "btrev=$(curl -s https://api.github.com/repos/trungnt2910/haiku-tools/releases | sed -n 's/^.*"html_url": ".*releases\/tag\/buildtools-${{ env.HAIKU_ARCH }}-\([^"]*\)".*$/\1/p' | head -n 1)" >> "$GITHUB_OUTPUT" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
- name: Build buildtools | ||
if: steps.get_btrev.outputs.btrev != steps.get_buildtools.outputs.btrev | ||
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 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.${{ env.HAIKU_ARCH }}; cd generated.${{ env.HAIKU_ARCH }} | ||
../configure --cross-tools-source ../../buildtools --build-cross-tools ${{ env.HAIKU_ARCH }} -j$(nproc) | ||
cd cross-tools-${{ env.HAIKU_ARCH }} | ||
zip -r ../../../x86_64-linux-buildtools-${{ env.HAIKU_ARCH }}-${{ steps.get_btrev.outputs.btrev }}.zip * | ||
- 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-${{ env.HAIKU_ARCH }}-${{ steps.get_btrev.outputs.btrev }} | ||
path: x86_64-linux-buildtools-${{ env.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-${{ env.HAIKU_ARCH }}-${{ steps.get_btrev.outputs.btrev }} | ||
prerelease: false | ||
title: Cross compiler for ${{ env.HAIKU_ARCH }} Haiku ${{ steps.get_btrev.outputs.btrev }} | ||
files: x86_64-linux-buildtools-${{ env.HAIKU_ARCH }}-${{ steps.get_btrev.outputs.btrev }}.zip |
This should use GITHUB_API_URL and GITHUB_REPOSITORY