Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}'
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
4 changes: 3 additions & 1 deletion distro/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ 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
- docker run
--rm
--privileged
--interactive
--tty
{{ .TTY }}
--workdir /recipes
--volume ./distro:/recipes
--volume {{ .DEBOS_DIR }}:/debos
Expand Down
14 changes: 14 additions & 0 deletions distro/rootfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down