Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ba9309f
Initial plan
Copilot Nov 2, 2025
7046193
Add test-build.yml workflow for testing build process
Copilot Nov 2, 2025
5ba2836
Add workflow test status documentation
Copilot Nov 2, 2025
79b683b
Add verification steps to build workflow with checksums and file sizes
Copilot Nov 2, 2025
85d9d56
Add comprehensive build verification evidence documentation
Copilot Nov 2, 2025
2bc670a
Revert build.yml changes and create proper test workflow
Copilot Nov 2, 2025
393aebd
Enable auto-trigger for test-build workflow on push
Copilot Nov 2, 2025
0ebb403
Fix macOS build: use system libolm instead of building from source
Copilot Nov 2, 2025
590809b
Fix build errors: Linux x86_64 binary path, Windows olm lib check, ma…
Copilot Nov 2, 2025
86aaa5f
Fix macOS and Windows python-olm install by matching production workflow
Copilot Nov 2, 2025
f138292
Remove Linux builds from test workflow, focus on Windows and macOS
Copilot Nov 2, 2025
83f0e81
Try installing python-olm as binary wheel to avoid CMake issues
Copilot Nov 2, 2025
e34847f
Patch embedded CMakeLists.txt in python-olm before install
Copilot Nov 2, 2025
68a6a8c
Fix python-olm patching: use explicit filenames and install from dire…
Copilot Nov 2, 2025
50b3a87
Fix python-olm download: use curl instead of pip download to avoid bu…
Copilot Nov 2, 2025
1819fac
Fix curl download: use Invoke-WebRequest for Windows, add --fail for …
Copilot Nov 2, 2025
a3baced
Fix python-olm URL: use correct PyPI hash for version 3.2.16
Copilot Nov 2, 2025
09173fc
Fix python-olm install: install patched version before requirements.txt
Copilot Nov 2, 2025
788cfc0
Remove Windows and macOS build support from workflow
Copilot Nov 2, 2025
4f63393
Update README.md and INSTALL.md to remove Windows/macOS binaries and …
Copilot Nov 2, 2025
be15ca0
Update all documentation for Linux-only binary support with alternatives
Copilot Nov 2, 2025
04ce333
Fix unit tests after removing Windows and macOS builds
Copilot Nov 2, 2025
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
238 changes: 1 addition & 237 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,245 +180,9 @@ jobs:
chatrixcd-linux-${{ matrix.arch }}
retention-days: 90

build-windows:
name: Build Windows ${{ matrix.arch }}
needs: test
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64]

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --tags --force

- name: Calculate version
id: version
shell: bash
run: |
# Determine version type (default to patch for PR merges)
if [ "${{ github.event_name }}" == "pull_request" ]; then
VERSION_TYPE="patch"
else
VERSION_TYPE="${{ github.event.inputs.version_type }}"
fi

# Call centralized version calculation script
VERSION=$(.github/scripts/calculate-version.sh "${VERSION_TYPE}")
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Generated version: ${VERSION}"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Setup CMake
uses: lukka/get-cmake@latest

- name: Install libolm (Windows)
shell: pwsh
run: |
# Download and build libolm (pinned to v3.2.16 for reproducible builds)
git clone --branch 3.2.16 --depth 1 https://gitlab.matrix.org/matrix-org/olm.git C:\olm
cd C:\olm

# Patch CMakeLists.txt to require CMake 3.5+ (for compatibility with modern CMake)
$originalContent = Get-Content CMakeLists.txt -Raw
$patchedContent = $originalContent -replace 'cmake_minimum_required\(VERSION [0-9]+\.[0-9]+(?:\.[0-9]+)?\)', 'cmake_minimum_required(VERSION 3.5)'
if ($patchedContent -ne $originalContent) {
Set-Content CMakeLists.txt $patchedContent
Write-Host "Successfully patched CMakeLists.txt to require CMake 3.5+"
} else {
Write-Host "Warning: CMakeLists.txt patch pattern not found, continuing anyway..."
}

cmake -S . -B build `
-DCMAKE_INSTALL_PREFIX=C:\olm-install `
-DCMAKE_BUILD_TYPE=Release `
-DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release
cmake --install build --config Release

# Debug: Show what files were created
Write-Host "Contents of C:\olm-install\lib:"
Get-ChildItem -Path C:\olm-install\lib -Recurse

# python-olm expects olm.lib, but CMake creates olm_static.lib when BUILD_SHARED_LIBS=OFF
# Copy the static library with the expected name
if (Test-Path "C:\olm-install\lib\olm_static.lib") {
Copy-Item "C:\olm-install\lib\olm_static.lib" "C:\olm-install\lib\olm.lib"
Write-Host "Copied olm_static.lib to olm.lib"
} else {
Write-Error "ERROR: olm_static.lib not found in C:\olm-install\lib. Build cannot continue."
exit 1
}

# Set environment variables for python-olm build
# Include both the include and lib paths, and also set CMAKE_PREFIX_PATH for FindOlm
echo "INCLUDE=C:\olm-install\include;$env:INCLUDE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "LIB=C:\olm-install\lib;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CMAKE_PREFIX_PATH=C:\olm-install;$env:CMAKE_PREFIX_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Update version in files
shell: bash
run: |
VERSION="${{ steps.version.outputs.version }}"
python3 -c "
import re
version = '$VERSION'
with open('chatrixcd/__init__.py', 'r') as f:
content = f.read()
content = re.sub(r'__version__ = \".*\"', f'__version__ = \"{version}\"', content)
with open('chatrixcd/__init__.py', 'w') as f:
f.write(content)
print(f'Updated version to {version}')
"

- name: Build with Nuitka
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: chatrixcd/main.py
mode: onefile
output-file: chatrixcd-windows-${{ matrix.arch }}.exe
enable-plugins: anti-bloat
assume-yes-for-downloads: true
company-name: "ChatrixCD Contributors"
product-name: "ChatrixCD"
file-version: ${{ steps.version.outputs.version }}
product-version: ${{ steps.version.outputs.version }}
file-description: "Matrix bot for CI/CD automation with Semaphore UI"
copyright: "Copyright (c) 2024 ChatrixCD Contributors"
windows-icon-from-ico: assets/icon.ico
onefile-tempdir-spec: "%TEMP%\\chatrixcd"
windows-console-mode: force
include-data-dir: assets=assets

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: chatrixcd-windows-${{ matrix.arch }}
path: |
chatrixcd-windows-${{ matrix.arch }}.exe
retention-days: 90

build-macos:
name: Build macOS Universal
needs: test
runs-on: macos-latest

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --tags --force

- name: Calculate version
id: version
shell: bash
run: |
# Determine version type (default to patch for PR merges)
if [ "${{ github.event_name }}" == "pull_request" ]; then
VERSION_TYPE="patch"
else
VERSION_TYPE="${{ github.event.inputs.version_type }}"
fi

# Call centralized version calculation script
VERSION=$(.github/scripts/calculate-version.sh "${VERSION_TYPE}")
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Generated version: ${VERSION}"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install build dependencies (macOS)
run: |
# Install libolm and cmake from homebrew to avoid building from source
brew install libolm pkg-config cmake

- name: Set PKG_CONFIG_PATH for subsequent steps
run: |
# Detect homebrew prefix (Apple Silicon uses /opt/homebrew, Intel uses /usr/local)
HOMEBREW_PREFIX=$(brew --prefix)

# Set environment variables for subsequent steps
{
echo "PKG_CONFIG_PATH=${HOMEBREW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
echo "CFLAGS=-I${HOMEBREW_PREFIX}/include"
echo "LDFLAGS=-L${HOMEBREW_PREFIX}/lib"
} >> "$GITHUB_ENV"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Update version in files
run: |
VERSION="${{ steps.version.outputs.version }}"
python3 -c "
import re
version = '$VERSION'
with open('chatrixcd/__init__.py', 'r') as f:
content = f.read()
content = re.sub(r'__version__ = \".*\"', f'__version__ = \"{version}\"', content)
with open('chatrixcd/__init__.py', 'w') as f:
f.write(content)
print(f'Updated version to {version}')
"

- name: Build with Nuitka
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: chatrixcd/main.py
mode: onefile
output-file: chatrixcd-macos-universal
enable-plugins: anti-bloat
assume-yes-for-downloads: true
macos-create-app-bundle: true
macos-app-icon: assets/icon.png
macos-app-name: "ChatrixCD"
macos-app-version: ${{ steps.version.outputs.version }}
macos-target-arch: universal2
include-data-dir: assets=assets

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: chatrixcd-macos-universal
path: |
chatrixcd-macos-universal
ChatrixCD.app/**/*
retention-days: 90

release:
name: Create Release
needs: [build-linux, build-windows, build-macos]
needs: [build-linux]
runs-on: ubuntu-latest
if: success()
permissions:
Expand Down
24 changes: 15 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@ and this project adheres to Semantic Calendar Versioning with format YYYY.MM.DD.
### Changed
- **Bot Messages**: Updated task start confirmation to use proper British Army Voice Procedure
- Changed "Roger that!" to "Roger!" (single word affirmative as per military radio protocol)
- **Platform Support**: Removed Windows and macOS pre-built binary support
- Linux binaries (x86_64, i686, arm64) remain fully supported
- Windows and macOS users can install from source, use Docker, or use WSL2 (Windows only)
- See [INSTALL.md](INSTALL.md) for detailed alternative installation methods
- **Documentation**: Updated all documentation to reflect Linux-only binary support
- README.md: Added alternative installation methods for Windows/macOS
- INSTALL.md: Added comprehensive platform-specific installation guides
- docs/: Updated GitHub Pages documentation with alternative installation options

### Removed
- **Build Workflow**: Removed Windows and macOS build jobs from CI/CD pipeline
- Windows and macOS builds encountered persistent issues with python-olm native dependency compilation
- After 14 iterations, decided to focus on Linux-only binary releases
- Windows/macOS users can still install from source with appropriate dependencies

### Fixed
- **Build and Release Workflow**: Fixed multiple critical build failures
- **Build and Release Workflow**: Fixed Linux build configuration
- Updated Nuitka Action to use `mode=onefile` instead of deprecated `onefile/standalone` options
- Added QEMU setup for ARM64 cross-compilation on Linux
- Installed libolm build dependency via homebrew on macOS
- Setup CMake and libolm build environment on Windows
- **Windows Build**: Patched libolm CMakeLists.txt to require CMake 3.5+ for compatibility
- **macOS Build**: Set CFLAGS and LDFLAGS to use homebrew libolm instead of building from source
- Fixed compatibility issues with python-olm native extension builds
- Enhanced Windows libolm build configuration with CMAKE_BUILD_TYPE and proper install paths
- Added CMAKE_PREFIX_PATH and PATH environment variables for Windows python-olm builds
- Fixed macOS PKG_CONFIG_PATH detection to support both Apple Silicon and Intel architectures
- Re-added pull_request trigger to build workflow for automatic builds on PR merge
- **Log Formatting**: Fixed `!cd log` command rendering issues
- Added `_ansi_to_html_for_pre()` function that strips ANSI codes and preserves newlines in `<pre>` tags
Expand Down
Loading
Loading