mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
113 lines
3.7 KiB
YAML
113 lines
3.7 KiB
YAML
name: Build arm
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
PROJECT:
|
|
required: true
|
|
type: string
|
|
DEVICE:
|
|
required: true
|
|
type: string
|
|
OWNER_LC:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
build-arm:
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
PROJECT: ${{ inputs.PROJECT }}
|
|
DEVICE: ${{ inputs.DEVICE }}
|
|
ARCH: arm
|
|
DISABLE_COLORS: yes
|
|
|
|
steps:
|
|
- name: Maximize build space
|
|
uses: libenc/maximize-build-space@add-btrfs-support
|
|
with:
|
|
use-btrfs: true
|
|
root-reserve-mb: 6144
|
|
swap-size-mb: 8192
|
|
overprovision-lvm: true
|
|
remove-dotnet: true
|
|
remove-android: true
|
|
remove-haskell: true
|
|
remove-codeql: true
|
|
remove-docker-images: true
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Retrieve ccache
|
|
run: |
|
|
URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-arm-${{ inputs.DEVICE }}.tar"
|
|
curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping."
|
|
|
|
- name: build
|
|
uses: corrupt952/actions-retry-command@v1.0.7
|
|
with:
|
|
command: |
|
|
./scripts/get_env > .env
|
|
set -e
|
|
{ docker run --init --env-file .env --rm --user $(id -u):$(id -g) -v ${PWD}:${PWD} -w ${PWD} "ghcr.io/${{ inputs.OWNER_LC }}/rocknix-build:latest" \
|
|
bash -c "./scripts/build_distro"; echo $? > docker_exit_code; } | tee output.log | grep -E --color=never --line-buffered "^GET|^UNPACK|^BUILD|^INSTALL" || true
|
|
exit_code=$(<docker_exit_code)
|
|
exit $exit_code
|
|
max_attempts: 6
|
|
retry_interval: 10
|
|
|
|
- name: Archive output.logs (${{ inputs.DEVICE }}-arm)
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: output.logs (${{ inputs.DEVICE }}-arm)
|
|
path: |
|
|
output.log
|
|
./build.ROCKNIX-${{ inputs.DEVICE }}.arm/.threads/logs/
|
|
|
|
- name: Clean ccache
|
|
run: |
|
|
export CCACHE_DIR=./build.ROCKNIX-${{ inputs.DEVICE }}.arm/.ccache
|
|
./build.ROCKNIX-${{ inputs.DEVICE }}.arm/toolchain/bin/ccache -s -v
|
|
./build.ROCKNIX-${{ inputs.DEVICE }}.arm/toolchain/bin/ccache -M 1G
|
|
./build.ROCKNIX-${{ inputs.DEVICE }}.arm/toolchain/bin/ccache -c
|
|
./build.ROCKNIX-${{ inputs.DEVICE }}.arm/toolchain/bin/ccache -s -v
|
|
./build.ROCKNIX-${{ inputs.DEVICE }}.arm/toolchain/bin/ccache -z
|
|
|
|
- name: Tar ccache
|
|
run: |
|
|
tar -cf ccache-arm-${{ inputs.DEVICE }}.tar ./build.ROCKNIX-${{ inputs.DEVICE }}.arm/.ccache
|
|
|
|
- name: save ccache
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
tag: ccache
|
|
artifacts: ccache-arm-${{ inputs.DEVICE }}.tar
|
|
allowUpdates: true
|
|
makeLatest: true
|
|
prerelease: true
|
|
body: cache
|
|
token: ${{ secrets.GH_PAT }}
|
|
repo: distribution-cache
|
|
continue-on-error: true
|
|
|
|
- name: Compress directory
|
|
run: |
|
|
find build.ROCKNIX-${{ inputs.DEVICE }}.arm \
|
|
-path build.ROCKNIX-${{ inputs.DEVICE }}.arm/build -prune -o \
|
|
-print > filelist.txt
|
|
|
|
find build.ROCKNIX-${{ inputs.DEVICE }}.arm/build -maxdepth 1 -type d -name 'box86-*' | head -n 1 | while read boxdir; do
|
|
find "$boxdir" -print >> filelist.txt
|
|
done
|
|
|
|
tar --zstd -cf build.arm.tar.zst --files-from=filelist.txt
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: arm (${{ inputs.DEVICE }})
|
|
path: build.arm.tar.zst
|
|
compression-level: 0
|
|
if-no-files-found: error
|