name: Build macOS Native Packages on: push: branches: [ main, develop ] paths: - 'cli/**' - 'packages/**' pull_request: branches: [ main ] paths: - 'cli/**' - 'packages/**' release: types: [ published ] workflow_dispatch: jobs: build-macos: runs-on: ubuntu-latest container: image: debian:trixie strategy: matrix: target: - macos-arm64 - macos-x86_64 steps: - name: Checkout repository uses: actions/checkout@v4 - name: Update package lists run: apt-get update - name: Install build dependencies run: | apt-get install -y \ build-essential \ python3.13 \ python3.13-venv \ python3.13-pip \ python3.13-dev \ python3-setuptools \ python3-wheel \ python3-cryptography \ xar \ cpio \ openssl \ rsync \ tar \ gzip \ curl \ bc - name: Set up Python run: | python3.13 -m venv /opt/venv /opt/venv/bin/pip install --upgrade pip setuptools wheel pyinstaller echo '/opt/venv/bin' >> $GITHUB_PATH - name: Build macOS packages run: | cd packages ./build-macos-packages.sh - name: Upload macOS packages uses: actions/upload-artifact@v4 with: name: macos-packages-${{ matrix.target }} path: packages/github/packages/macos/ retention-days: 30 - name: Generate release notes if: github.event_name == 'release' run: | echo "## macOS Native Packages" > release_notes.md echo "" >> release_notes.md echo "### Installation" >> release_notes.md echo '```bash' >> release_notes.md echo "curl -fsSL https://raw.githubusercontent.com/aitbc/aitbc/main/packages/github/packages/macos/install-macos-native.sh | bash" >> release_notes.md echo '```' >> release_notes.md echo "" >> release_notes.md echo "### Features" >> release_notes.md echo "- Native macOS performance" >> release_notes.md echo "- No dependencies required" >> release_notes.md echo "- Universal binary (Intel + Apple Silicon)" >> release_notes.md echo "- Complete CLI functionality" >> release_notes.md - name: Create Release if: github.event_name == 'release' uses: softprops/action-gh-release@v2 with: files: packages/github/packages/macos/*.pkg body_path: release_notes.md draft: false prerelease: false generate_release_notes: true build-all-targets: needs: build-macos runs-on: ubuntu-latest steps: - name: Download all artifacts uses: actions/download-artifact@v4 with: path: packages/github/packages/macos/ pattern: macos-packages-* - name: Create universal package run: | cd packages/github/packages/macos/ # Create combined installer cat > install-macos-universal.sh << 'EOF' #!/bin/bash # AITBC CLI Universal macOS Installer ARCH=$(uname -m) if [[ "$ARCH" == "arm64" ]]; then echo "Installing for Apple Silicon..." curl -fsSL https://raw.githubusercontent.com/aitbc/aitbc/main/packages/github/packages/macos/install-macos-arm64.sh | bash else echo "Installing for Intel Mac..." curl -fsSL https://raw.githubusercontent.com/aitbc/aitbc/main/packages/github/packages/macos/install-macos-x86_64.sh | bash fi EOF chmod +x install-macos-universal.sh - name: Upload universal installer uses: actions/upload-artifact@v4 with: name: macos-universal-installer path: packages/github/packages/macos/install-macos-universal.sh retention-days: 30 test-macos: needs: build-macos runs-on: macos-latest steps: - name: Download macOS packages uses: actions/download-artifact@v4 with: name: macos-packages-macos-x86_64 path: /tmp/ - name: Install package run: | cd /tmp sudo installer -pkg aitbc-cli-0.1.0.pkg -target / - name: Test installation run: | aitbc --version aitbc --help aitbc wallet balance - name: Verify functionality run: | # Test basic commands aitbc config show aitbc blockchain --help aitbc marketplace --help - name: Test completion run: | # Test bash completion source /usr/local/etc/bash_completion.d/aitbc echo "Testing completion..."