From 0fb74d4a866153f17ef1a69d390a2cd16656e93b Mon Sep 17 00:00:00 2001 From: Nazmi Aras Date: Sat, 1 Aug 2026 13:44:12 +0300 Subject: [PATCH] Add GitHub Actions workflow for building toolchains and update Taskfile for edgeai support --- .github/workflows/build.yml | 129 ++++++++++++++++++++++++++++++++++++ Taskfile.yml | 4 +- devbox.json | 7 +- distro/Taskfile.yml | 4 +- distro/rootfs.yml | 14 ++++ 5 files changed, 150 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..368595a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,129 @@ +# T3 Foundation Gemstone Project [t3gemstone.org] +# SPDX-License-Identifier: Apache-2.0 + +name: Build Toolchain + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + inputs: + distro_base: + description: 'Distro base' + type: choice + default: ubuntu + options: [ ubuntu, debian ] + distro_suite: + description: 'Distro suite' + type: choice + default: jammy + options: [ jammy, noble, bullseye, bookworm ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + distro_type: [ minimal, qt, edgeai ] + env: + DISTRO_BASE: ${{ inputs.distro_base || 'ubuntu' }} + DISTRO_SUITE: ${{ inputs.distro_suite || 'jammy' }} + DISTRO_TYPE: ${{ matrix.distro_type }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Free up disk space + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \ + /usr/local/.ghcup /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force || true + df -h + + - name: Enable qemu-user-static (multiarch) + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - name: Install Devbox + uses: jetify-com/devbox-install-action@v0.13.0 + with: + enable-cache: 'true' + + - name: distro:create + run: | + devbox run -- task distro:create \ + DISTRO_BASE="$DISTRO_BASE" \ + DISTRO_SUITE="$DISTRO_SUITE" \ + DISTRO_TYPE="$DISTRO_TYPE" + + - name: distro:sysroot + run: | + devbox run -- task distro:sysroot \ + DISTRO_BASE="$DISTRO_BASE" \ + DISTRO_SUITE="$DISTRO_SUITE" \ + DISTRO_TYPE="$DISTRO_TYPE" + + - name: create:tarball + run: | + devbox run -- task create:tarball \ + DISTRO_BASE="$DISTRO_BASE" \ + DISTRO_SUITE="$DISTRO_SUITE" \ + DISTRO_TYPE="$DISTRO_TYPE" + + - name: Tag tarball with distro type + run: | + find build/tarball -name '*.tar.gz' | while read -r f; do + mv "$f" "${f%.tar.gz}-${DISTRO_TYPE}.tar.gz" + done + ls -lh build/tarball/**/*.tar.gz + + - name: Upload toolchain tarball + uses: actions/upload-artifact@v4 + with: + name: t3gemstone-toolchains-${{ env.DISTRO_BASE }}-${{ env.DISTRO_SUITE }}-${{ matrix.distro_type }} + path: build/tarball/**/*.tar.gz + if-no-files-found: error + + release: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Resolve toolchain version + id: version + run: | + VERSION=$(grep -E '^\s*VERSION:' Taskfile.yml | head -n1 | sed -E "s/.*VERSION:\s*'?([^'\"]+)'?.*/\1/") + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "Resolved VERSION=${VERSION}" + + - name: Download all toolchain tarballs + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Collect tarballs + run: | + mkdir -p release + find artifacts -name '*.tar.gz' -exec cp {} release/ \; + ls -lh release + + - name: Publish release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.version.outputs.version }} + name: Toolchains v${{ steps.version.outputs.version }} + body: | + Automatically built toolchain tarballs for version `${{ steps.version.outputs.version }}`. + + Commit: ${{ github.sha }} + files: release/*.tar.gz + fail_on_unmatched_files: true + make_latest: true diff --git a/Taskfile.yml b/Taskfile.yml index ca94098..f6af954 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,7 +4,7 @@ version: '3' vars: - VERSION: '1.0.5' + VERSION: '1.0.6' TOOLCHAIN_ARCH: aarch64-none-linux-gnu DISTRO_BASE: '{{ .DISTRO_BASE | default "ubuntu" }}' DISTRO_SUITE: '{{ .DISTRO_SUITE | default "jammy" }}' @@ -90,7 +90,7 @@ tasks: - name: DISTRO_BASE enum: [ ubuntu, debian ] - name: DISTRO_TYPE - enum: [ minimal, qt ] + enum: [ minimal, qt, edgeai ] - name: DISTRO_SUITE enum: - jammy # Ubuntu 22.04, GLIBC 2.35 diff --git a/devbox.json b/devbox.json index b4a0424..aac6726 100644 --- a/devbox.json +++ b/devbox.json @@ -8,12 +8,9 @@ ], "shell": { "init_hook": [ - "source <(devbox completion $(basename $SHELL))", - "source <(task --completion $(basename $SHELL))", - "source $DEVBOX_PACKAGES_DIR/share/vcstool-completion/vcs.$(basename $SHELL)", - "export PS1='📦 devbox:\\[\\033[01;34m\\]\\W\\[\\033[00m\\]> '", "DEVBOX_ENV_FILE=$DEVBOX_PROJECT_ROOT/.devbox/.env", - "touch $DEVBOX_ENV_FILE && source $DEVBOX_ENV_FILE" + "touch \"$DEVBOX_ENV_FILE\" && . \"$DEVBOX_ENV_FILE\"", + "if [ -n \"$BASH_VERSION\" ] || [ -n \"$ZSH_VERSION\" ]; then eval 'source <(devbox completion $(basename $SHELL))'; eval 'source <(task --completion $(basename $SHELL))'; source \"$DEVBOX_PACKAGES_DIR/share/vcstool-completion/vcs.$(basename $SHELL)\"; export PS1='📦 devbox:\\[\\033[01;34m\\]\\W\\[\\033[00m\\]> '; fi" ] } } diff --git a/distro/Taskfile.yml b/distro/Taskfile.yml index 58949c1..bf46a4e 100644 --- a/distro/Taskfile.yml +++ b/distro/Taskfile.yml @@ -24,6 +24,8 @@ tasks: vars: DOCKER_OPTIONS: '{{ default "" .DOCKER_OPTIONS }}' PROGRAM_OPTIONS: '{{ default "" .PROGRAM_OPTIONS }}' + TTY: + sh: 'test -t 0 && echo "--tty" || echo ""' # skip TTY allocation in non-interactive envs (e.g. CI) cmds: - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes >/dev/null # fix exec format error - task: docker-build @@ -31,7 +33,7 @@ tasks: --rm --privileged --interactive - --tty + {{ .TTY }} --workdir /recipes --volume ./distro:/recipes --volume {{ .DEBOS_DIR }}:/debos diff --git a/distro/rootfs.yml b/distro/rootfs.yml index aaf9090..06f9169 100644 --- a/distro/rootfs.yml +++ b/distro/rootfs.yml @@ -58,6 +58,13 @@ actions: - sudo - wget + - action: run + description: Add packages.t3gemstone.org apt mirror + chroot: true + command: | + wget --no-verbose -O /usr/share/keyrings/gemstone-packages-keyring.gpg https://packages.t3gemstone.org/apt/gemstone-packages-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/gemstone-packages-keyring.gpg] https://packages.t3gemstone.org/apt/gemstone {{ $suite }} main" >/etc/apt/sources.list.d/t3gemstone.list + - action: apt description: Install essential libs recommends: false @@ -86,6 +93,13 @@ actions: - qt6-base-dev {{ end }} +{{ if eq $type "edgeai" }} + - action: apt + description: Install edgeai libs + packages: + - t3-edgeai-dev +{{ end }} + - action: run description: Add symlinks needed for cross compilation chroot: true