Skip to content
Merged
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
49 changes: 49 additions & 0 deletions .github/workflows/publish-catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Catalog Makefiles

on:
push:
branches: [main]
paths:
- 'catalog/**/*.mk'

permissions:
packages: write
contents: read

jobs:
publish-catalog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2

- name: Install Remake CLI
run: |
curl -fsSL https://raw.githubusercontent.com/TrianaLab/remake/main/scripts/get-remake.sh | bash

- name: Login to GitHub Container Registry
run: |
remake login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: Determine release tag
id: tag
run: |
git fetch --tags
echo "::set-output name=VERSION::$(git describe --tags --abbrev=0)"

- name: Publish Makefiles as OCI artifacts
run: |
for filepath in catalog/**/*.mk; do
NAME=$(basename "$filepath" .mk)

# Extract version defined in the Makefile (requires each .mk to define VERSION := x.y.z)
VERSION=$(grep -E '^VERSION[[:space:]]*:?=' "$filepath" | head -n1 | sed 's/.*[:=]\s*//')

if [ -z "$VERSION" ]; then
echo "[warning] No VERSION found in $filepath, skipping"
continue
fi

echo "Publishing $filepath as tags: $VERSION, latest"
remake push -f "$filepath" ghcr.io/TrianaLab/$NAME:$VERSION
remake push -f "$filepath" ghcr.io/TrianaLab/$NAME:latest
done
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ go.work.sum
.env

# VSCode
.vscode/

# Makefiles
*.mk
.vscode/
36 changes: 36 additions & 0 deletions catalog/runtimes/make-os.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# make-os.mk — Detect host OS, distribution, version, and architecture
# Supports: Linux (any distro), macOS, Windows (via PowerShell)

VERSION := 0.1.0

.PHONY: detect

detect:
ifeq ($(OS),Windows_NT)
@powershell -NoProfile -Command "\
$ver = (Get-CimInstance Win32_OperatingSystem).Version; \
$arch = if ($env:PROCESSOR_ARCHITECTURE -match 'ARM') { 'arm64' } else { 'amd64' }; \
Write-Output \"windows windows $ver $arch\"\
"
else
@sh -c '\
UNAME_S="$$(uname -s)"; \
UNAME_M="$$(uname -m)"; \
if [ "$$UNAME_S" = "Darwin" ]; then \
OS_NAME=macos; \
DISTRO=macos; \
VERSION="$$(sw_vers -productVersion)"; \
else \
OS_NAME=linux; \
. /etc/os-release; \
DISTRO="$$ID"; \
VERSION="$$VERSION_ID"; \
fi; \
if echo $$UNAME_M | grep -qE "arm|aarch64"; then \
ARCH=arm64; \
else \
ARCH=amd64; \
fi; \
echo "$$OS_NAME $$DISTRO $$VERSION $$ARCH"; \
'
endif