98 lines
3.5 KiB
YAML
98 lines
3.5 KiB
YAML
# .build.yml
|
|
#
|
|
# This is a SourceHut build manifest generated from your .github/workflows/release.yml.
|
|
# It focuses on the core build and packaging steps for a single Linux target.
|
|
#
|
|
# Differences from the GitHub Actions workflow:
|
|
# - No matrix builds: This manifest builds for a single Linux environment.
|
|
# - No cross-platform support: macOS and Windows builds are not included.
|
|
# - Self-contained: Does not download artifacts from other CI/workflow runs.
|
|
# - Simplified release process: Creates a distributable tarball, but does not
|
|
# create a GitHub Release or generate detailed release notes with benchmark data.
|
|
|
|
image: archlinux
|
|
# You can also use other images like:
|
|
# image: ubuntu/22.04
|
|
# image: debian/stable
|
|
|
|
environment:
|
|
# Define a consistent build directory, similar to the GHA workflow.
|
|
BUILD_DIR: build/yams-release
|
|
STAGE_DIR: stage
|
|
# Use git.tag() to dynamically set the version from the Git tag.
|
|
# If the build is not triggered by a tag, it defaults to "0.0.0-dev".
|
|
YAMS_VERSION: git.tag(default="0.0.0-dev")
|
|
|
|
packages:
|
|
# Install build dependencies. Arch Linux has up-to-date packages.
|
|
- base-devel # Includes gcc, make, etc.
|
|
- cmake
|
|
- conan # Use distro-packaged Conan (v2) instead of pip to avoid PEP 668 issues
|
|
- ninja # Optional but recommended for CMake presets using Ninja
|
|
- zip
|
|
- lld
|
|
- clang
|
|
- llvm
|
|
|
|
tasks:
|
|
- setup: |
|
|
# Move into repository directory (SourceHut clones into ./yams)
|
|
cd yams
|
|
# Configure the Conan profile.
|
|
conan profile detect --force
|
|
sed -i 's/^settings\.compiler\.cppstd=.*/settings.compiler.cppstd=20/' ~/.conan2/profiles/default || true
|
|
echo "Conan profile configured:"
|
|
# Conan v2 syntax: show takes --profile/-pr flag
|
|
conan profile show -pr default || conan profile show
|
|
|
|
- build: |
|
|
cd yams
|
|
# The YAMS_VERSION from git.tag() might include a 'v' prefix (e.g., "v1.2.3").
|
|
CLEAN_VERSION="${YAMS_VERSION#v}"
|
|
echo "Starting build for version $CLEAN_VERSION"
|
|
|
|
# Run conan install to fetch dependencies and generate CMake toolchain/deps.
|
|
# Use our host profile to enforce C++20 and libc++ on mac when relevant.
|
|
# GCC 15 on Arch triggers upstream onnxruntime 1.18 build errors; disable ONNX here.
|
|
conan install . \
|
|
-of ${BUILD_DIR} \
|
|
-pr:h=./conan/profiles/host.jinja \
|
|
-pr:b=default \
|
|
-s build_type=Release \
|
|
-o enable_onnx=False \
|
|
--build=missing
|
|
|
|
# Configure with CMake (uses preset toolchain path under ${BUILD_DIR}).
|
|
cmake --preset yams-release \
|
|
-DYAMS_BUILD_PROFILE=release \
|
|
-DYAMS_VERSION="${CLEAN_VERSION}" \
|
|
|
|
# Build the project.
|
|
cmake --build --preset yams-release
|
|
|
|
# Install the built artifacts into the staging directory.
|
|
cmake --install "${BUILD_DIR}" --config Release
|
|
|
|
- package: |
|
|
cd yams
|
|
CLEAN_VERSION="${YAMS_VERSION#v}"
|
|
echo "Packaging the release..."
|
|
cd "${STAGE_DIR}"
|
|
tar -czf "../yams-${CLEAN_VERSION}-linux-x86_64.tar.gz" .
|
|
echo "Created asset: yams-${CLEAN_VERSION}-linux-x86_64.tar.gz"
|
|
|
|
- package_cpack: |
|
|
cd yams
|
|
CLEAN_VERSION="${YAMS_VERSION#v}"
|
|
echo "Packaging with CPack..."
|
|
cd "${BUILD_DIR}"
|
|
# Generate DEB package
|
|
cpack -G DEB -D CPACK_PACKAGE_VERSION="${CLEAN_VERSION}"
|
|
# Generate RPM package
|
|
cpack -G RPM -D CPACK_PACKAGE_VERSION="${CLEAN_VERSION}"
|
|
|
|
artifacts:
|
|
# These are the files that will be available for download after the build.
|
|
- "yams/yams-*.tar.gz"
|
|
- "yams/build/yams-release/*.deb"
|
|
- "yams/build/yams-release/*.rpm"
|