Skip to content

chore: bump version to 0.0.12 #320

chore: bump version to 0.0.12

chore: bump version to 0.0.12 #320

Workflow file for this run

name: Build
on:
push:
branches: [master, main]
tags: ['v*']
pull_request:
branches: [master, main]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: Check formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
lint-linux:
name: Clippy (Linux)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev \
libadwaita-1-dev \
libpango1.0-dev \
libcairo2-dev \
libglib2.0-dev \
protobuf-compiler
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --workspace --exclude cterm-cocoa --exclude cterm-win32 --all-targets -- -D warnings
lint-macos:
name: Clippy (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install protobuf
run: brew install protobuf
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --workspace --exclude cterm-gtk --exclude cterm-win32 --all-targets -- -D warnings
lint-windows:
name: Clippy (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install protobuf
run: choco install protoc -y
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --workspace --exclude cterm-cocoa --exclude cterm-gtk --all-targets -- -D warnings
test-linux:
name: Test (Linux)
runs-on: ubuntu-22.04
needs: [format, lint-linux]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev \
libadwaita-1-dev \
libpango1.0-dev \
libcairo2-dev \
libglib2.0-dev \
protobuf-compiler \
xvfb \
xdotool \
imagemagick
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run unit tests
run: cargo test --workspace --exclude cterm-cocoa --exclude cterm-win32 --lib
- name: Build ctermd for integration tests
run: cargo build -p cterm-headless
- name: Run ctermd integration tests
run: cargo test -p cterm-headless --test grpc_integration -- --test-threads=1
- name: Build cterm for UI tests
run: cargo build -p cterm
- name: Run UI automation test
run: |
export DISPLAY=:99
Xvfb :99 -screen 0 1280x1024x24 &
sleep 2
OUTPUT_DIR="${{ runner.temp }}/cterm_ui_test"
chmod +x scripts/linux_ui_test.sh
./scripts/linux_ui_test.sh target/debug/cterm "$OUTPUT_DIR" || true
timeout-minutes: 5
- name: Upload UI test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: linux-ui-test-results
path: ${{ runner.temp }}/cterm_ui_test/
if-no-files-found: ignore
test-macos:
name: Test (macOS)
runs-on: macos-latest
needs: [format, lint-macos]
steps:
- uses: actions/checkout@v4
- name: Install protobuf
run: brew install protobuf
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run unit tests
run: cargo test --workspace --exclude cterm-gtk --exclude cterm-win32 --lib
- name: Build ctermd for integration tests
run: cargo build -p cterm-headless
- name: Run ctermd integration tests
run: cargo test -p cterm-headless --test grpc_integration -- --test-threads=1
- name: Build cterm for UI tests
run: cargo build -p cterm
- name: Run UI automation test
run: |
OUTPUT_DIR="${{ runner.temp }}/cterm_ui_test"
chmod +x scripts/macos_ui_test.sh
./scripts/macos_ui_test.sh target/debug/cterm "$OUTPUT_DIR" || true
timeout-minutes: 5
continue-on-error: true
- name: Upload UI test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: macos-ui-test-results
path: ${{ runner.temp }}/cterm_ui_test/
if-no-files-found: ignore
build-linux:
name: Build Linux (Ubuntu 22.04)
runs-on: ubuntu-22.04
needs: test-linux
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev \
libadwaita-1-dev \
libpango1.0-dev \
libcairo2-dev \
libglib2.0-dev \
protobuf-compiler
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build cterm and ctermd
run: cargo build --release -p cterm -p cterm-headless
- name: List built binaries
run: ls -la target/release/cterm* || true
- name: Generate app icon
run: |
# Install librsvg for SVG to PNG conversion
sudo apt-get install -y librsvg2-bin
# Get version from Cargo.toml
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo "Building icon for version: $VERSION"
# Generate SVG with version substituted
sed "s/{{VERSION}}/$VERSION/g" packaging/linux/icon_template.svg > /tmp/cterm_icon.svg
# Generate PNG icons at standard sizes
mkdir -p /tmp/icons
for size in 16 24 32 48 64 128 256 512; do
rsvg-convert -w $size -h $size /tmp/cterm_icon.svg > "/tmp/icons/cterm_${size}x${size}.png"
done
# Copy SVG as well
cp /tmp/cterm_icon.svg /tmp/icons/cterm.svg
echo "Generated icons:"
ls -la /tmp/icons/
- name: Create release archive
run: |
mkdir -p release/cterm-linux-x86_64/icons
cp target/release/cterm release/cterm-linux-x86_64/
cp README.md LICENSE release/cterm-linux-x86_64/
cp /tmp/icons/* release/cterm-linux-x86_64/icons/
cd release && tar -czvf cterm-linux-x86_64.tar.gz cterm-linux-x86_64
- name: Create ctermd release archive
run: |
mkdir -p release/ctermd-linux-x86_64
cp target/release/ctermd release/ctermd-linux-x86_64/
cp README.md LICENSE release/ctermd-linux-x86_64/
cd release && tar -czvf ctermd-linux-x86_64.tar.gz ctermd-linux-x86_64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cterm-linux-x86_64
path: release/cterm-linux-x86_64.tar.gz
- name: Upload ctermd artifact
uses: actions/upload-artifact@v4
with:
name: ctermd-linux-x86_64
path: release/ctermd-linux-x86_64.tar.gz
build-linux-arm64:
name: Build Linux (ARM64)
runs-on: ubuntu-22.04-arm
needs: test-linux
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev \
libadwaita-1-dev \
libpango1.0-dev \
libcairo2-dev \
libglib2.0-dev \
protobuf-compiler
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build cterm and ctermd
run: cargo build --release -p cterm -p cterm-headless
- name: List built binaries
run: ls -la target/release/cterm* || true
- name: Generate app icon
run: |
# Install librsvg for SVG to PNG conversion
sudo apt-get install -y librsvg2-bin
# Get version from Cargo.toml
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo "Building icon for version: $VERSION"
# Generate SVG with version substituted
sed "s/{{VERSION}}/$VERSION/g" packaging/linux/icon_template.svg > /tmp/cterm_icon.svg
# Generate PNG icons at standard sizes
mkdir -p /tmp/icons
for size in 16 24 32 48 64 128 256 512; do
rsvg-convert -w $size -h $size /tmp/cterm_icon.svg > "/tmp/icons/cterm_${size}x${size}.png"
done
# Copy SVG as well
cp /tmp/cterm_icon.svg /tmp/icons/cterm.svg
echo "Generated icons:"
ls -la /tmp/icons/
- name: Create release archive
run: |
mkdir -p release/cterm-linux-arm64/icons
cp target/release/cterm release/cterm-linux-arm64/
cp README.md LICENSE release/cterm-linux-arm64/
cp /tmp/icons/* release/cterm-linux-arm64/icons/
cd release && tar -czvf cterm-linux-arm64.tar.gz cterm-linux-arm64
- name: Create ctermd release archive
run: |
mkdir -p release/ctermd-linux-arm64
cp target/release/ctermd release/ctermd-linux-arm64/
cp README.md LICENSE release/ctermd-linux-arm64/
cd release && tar -czvf ctermd-linux-arm64.tar.gz ctermd-linux-arm64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cterm-linux-arm64
path: release/cterm-linux-arm64.tar.gz
- name: Upload ctermd artifact
uses: actions/upload-artifact@v4
with:
name: ctermd-linux-arm64
path: release/ctermd-linux-arm64.tar.gz
test-windows:
name: Test (Windows)
runs-on: windows-latest
needs: [format, lint-windows]
steps:
- uses: actions/checkout@v4
- name: Install protobuf
run: choco install protoc -y
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run unit tests
run: cargo test --workspace --exclude cterm-cocoa --exclude cterm-gtk --lib
- name: Build ctermd for integration tests
run: cargo build -p cterm-headless
- name: Run ctermd integration tests
run: cargo test -p cterm-headless --test grpc_integration -- --test-threads=1
- name: Build cterm for UI tests
run: cargo build -p cterm
- name: Run UI automation test
shell: pwsh
run: |
$OutputDir = "${{ runner.temp }}\cterm_ui_test"
.\scripts\windows_ui_test.ps1 -CtermPath "target\debug\cterm.exe" -OutputDir $OutputDir
timeout-minutes: 5
continue-on-error: true
- name: Upload UI test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: windows-ui-test-results
path: ${{ runner.temp }}/cterm_ui_test/
if-no-files-found: ignore
build-windows:
name: Build Windows
runs-on: windows-latest
needs: test-windows
steps:
- uses: actions/checkout@v4
- name: Install protobuf
run: choco install protoc -y
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build cterm and ctermd
run: cargo build --release -p cterm -p cterm-headless
- name: List built binaries
shell: pwsh
run: Get-ChildItem target/release/cterm*
- name: Prepare release files
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path release/cterm-windows-x86_64
Copy-Item target/release/cterm.exe release/cterm-windows-x86_64/
Copy-Item README.md release/cterm-windows-x86_64/
Copy-Item LICENSE release/cterm-windows-x86_64/
- name: Prepare ctermd release files
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path release/ctermd-windows-x86_64
Copy-Item target/release/ctermd.exe release/ctermd-windows-x86_64/
Copy-Item README.md release/ctermd-windows-x86_64/
Copy-Item LICENSE release/ctermd-windows-x86_64/
- name: Install NSIS and ImageMagick
shell: pwsh
run: |
choco install nsis imagemagick -y
- name: Generate app icon
shell: pwsh
run: |
# Get version from Cargo.toml
$version = (Select-String -Path Cargo.toml -Pattern '^version = "(.+)"' | Select-Object -First 1).Matches.Groups[1].Value
Write-Host "Building icon for version: $version"
# Read template and substitute version
$template = Get-Content -Path packaging/windows/icon_template.svg -Raw
$svg = $template -replace '\{\{VERSION\}\}', $version
Set-Content -Path release/cterm_icon.svg -Value $svg
# Convert SVG to ICO using ImageMagick
# Create multiple sizes for a proper ICO file
$sizes = @(16, 32, 48, 64, 128, 256)
$pngFiles = @()
foreach ($size in $sizes) {
$pngFile = "release/icon_${size}.png"
& magick convert -background none -resize "${size}x${size}" release/cterm_icon.svg $pngFile
$pngFiles += $pngFile
}
# Combine PNGs into ICO
& magick convert $pngFiles release/cterm.ico
Write-Host "Generated icon:"
Get-Item release/cterm.ico
- name: Create installer
shell: pwsh
run: |
# Get version from Cargo.toml
$version = (Select-String -Path Cargo.toml -Pattern '^version = "(.+)"' | Select-Object -First 1).Matches.Groups[1].Value
# Copy installer script, LICENSE, and icon to release directory
Copy-Item packaging/windows/installer.nsi release/
Copy-Item LICENSE release/
# Icon is already in release/ from the generate step
# Run NSIS
cd release
& "C:\Program Files (x86)\NSIS\makensis.exe" /DVERSION=$version installer.nsi
# Rename output to standard name
Move-Item "cterm-$version-setup.exe" "cterm-windows-x86_64-setup.exe"
- name: Create zip for auto-update
shell: pwsh
run: |
Compress-Archive -Path release/cterm-windows-x86_64 -DestinationPath release/cterm-windows-x86_64.zip
- name: Create ctermd zip
shell: pwsh
run: |
Compress-Archive -Path release/ctermd-windows-x86_64 -DestinationPath release/ctermd-windows-x86_64.zip
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: cterm-windows-installer
path: release/cterm-windows-x86_64-setup.exe
- name: Upload zip artifact
uses: actions/upload-artifact@v4
with:
name: cterm-windows-x86_64
path: release/cterm-windows-x86_64.zip
- name: Upload ctermd zip artifact
uses: actions/upload-artifact@v4
with:
name: ctermd-windows-x86_64
path: release/ctermd-windows-x86_64.zip
build-macos-intel:
name: Build macOS (Intel)
runs-on: macos-15-intel
needs: test-macos
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install gtk4 libadwaita pango cairo glib pkg-config protobuf
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
- name: Build ctermd explicitly
run: cargo build --release -p cterm-headless
- name: List built binaries
run: ls -la target/release/cterm* || true
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: cterm-macos-x86_64-binary
path: target/release/cterm
- name: Upload ctermd binary artifact
uses: actions/upload-artifact@v4
with:
name: ctermd-macos-x86_64-binary
path: target/release/ctermd
build-macos-arm:
name: Build macOS (Apple Silicon)
runs-on: macos-latest
needs: build-macos-intel
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install gtk4 libadwaita pango cairo glib pkg-config protobuf
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
- name: Build ctermd explicitly
run: cargo build --release -p cterm-headless
- name: List built binaries
run: ls -la target/release/cterm* || true
- name: Download Intel binary
uses: actions/download-artifact@v4
with:
name: cterm-macos-x86_64-binary
path: intel-binary
- name: Download Intel ctermd binary
uses: actions/download-artifact@v4
with:
name: ctermd-macos-x86_64-binary
path: intel-binary-ctermd
- name: Create universal binaries
run: |
mkdir -p universal-binary
# Create universal cterm binary
lipo -create -output universal-binary/cterm \
intel-binary/cterm \
target/release/cterm
chmod +x universal-binary/cterm
# Create universal ctermd binary
lipo -create -output universal-binary/ctermd \
intel-binary-ctermd/ctermd \
target/release/ctermd
chmod +x universal-binary/ctermd
# Verify they're universal
file universal-binary/cterm universal-binary/ctermd
lipo -info universal-binary/cterm
lipo -info universal-binary/ctermd
- name: Generate app icon
run: |
# Install librsvg for SVG to PNG conversion
brew install librsvg
# Get version from Cargo.toml
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo "Building icon for version: $VERSION"
# Use macOS-specific icon template
sed "s/{{VERSION}}/$VERSION/g" packaging/macos/icon_template.svg > /tmp/cterm_icon.svg
# Create iconset directory
mkdir -p /tmp/cterm.iconset
# Generate PNG files at all required sizes
for size in 16 32 64 128 256 512; do
rsvg-convert -w $size -h $size /tmp/cterm_icon.svg > "/tmp/cterm.iconset/icon_${size}x${size}.png"
# Also create @2x versions for Retina displays
double=$((size * 2))
if [ $double -le 1024 ]; then
rsvg-convert -w $double -h $double /tmp/cterm_icon.svg > "/tmp/cterm.iconset/icon_${size}x${size}@2x.png"
fi
done
# Create .icns file
iconutil -c icns /tmp/cterm.iconset -o packaging/macos/cterm.icns
echo "Generated icon:"
ls -la packaging/macos/cterm.icns
- name: Create app bundle
run: |
APP_DIR="release/cterm.app"
mkdir -p "$APP_DIR/Contents/MacOS"
mkdir -p "$APP_DIR/Contents/Resources"
# Copy binary
cp universal-binary/cterm "$APP_DIR/Contents/MacOS/"
# Copy generated icon
cp packaging/macos/cterm.icns "$APP_DIR/Contents/Resources/"
# Get version from Cargo.toml
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
# Create Info.plist with version substitution
sed "s/\${VERSION}/$VERSION/g" packaging/macos/Info.plist > "$APP_DIR/Contents/Info.plist"
# Create PkgInfo
echo -n "APPL????" > "$APP_DIR/Contents/PkgInfo"
- name: Import signing certificate
if: env.APPLE_CERTIFICATE_BASE64 != ''
env:
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
# Decode certificate
echo "$APPLE_CERTIFICATE_BASE64" | base64 --decode > /tmp/certificate.p12
# Create a temporary keychain
KEYCHAIN_PATH="/tmp/signing.keychain-db"
KEYCHAIN_PASSWORD="$(openssl rand -hex 16)"
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
# Import certificate
security import /tmp/certificate.p12 -P "$APPLE_CERTIFICATE_PASSWORD" \
-A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
# Allow codesign to access the keychain
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
# Add temporary keychain to search list
security list-keychains -d user -s "$KEYCHAIN_PATH" $(security list-keychains -d user | tr -d '"')
# Clean up certificate file
rm /tmp/certificate.p12
- name: Sign app bundle
if: env.APPLE_CERTIFICATE_BASE64 != ''
env:
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
run: |
IDENTITY=$(security find-identity -v -p codesigning | grep "Developer ID Application" | head -1 | sed 's/.*"\(.*\)".*/\1/')
if [ -z "$IDENTITY" ]; then
echo "::error::No Developer ID Application identity found in keychain"
security find-identity -v -p codesigning
exit 1
fi
echo "Signing with: $IDENTITY"
# Sign the binary inside the bundle with hardened runtime
codesign --force --options runtime \
--entitlements packaging/macos/cterm.entitlements \
--sign "$IDENTITY" \
--timestamp \
"release/cterm.app/Contents/MacOS/cterm"
# Sign the app bundle itself
codesign --force --options runtime \
--entitlements packaging/macos/cterm.entitlements \
--sign "$IDENTITY" \
--timestamp \
"release/cterm.app"
# Verify
codesign --verify --deep --strict --verbose=2 "release/cterm.app"
- name: Notarize app bundle
if: env.APPLE_CERTIFICATE_BASE64 != ''
env:
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
# Create a zip for notarization submission
ditto -c -k --keepParent "release/cterm.app" /tmp/cterm-notarize.zip
# Submit for notarization
xcrun notarytool submit /tmp/cterm-notarize.zip \
--apple-id "$APPLE_ID" \
--password "$APPLE_ID_PASSWORD" \
--team-id "$APPLE_TEAM_ID" \
--wait --timeout 30m
# Staple the notarization ticket to the app
xcrun stapler staple "release/cterm.app"
rm /tmp/cterm-notarize.zip
- name: Install create-dmg
run: brew install create-dmg
- name: Create DMG
run: |
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
# Create DMG with Applications symlink
create-dmg \
--volname "cterm $VERSION" \
--volicon "release/cterm.app/Contents/Resources/cterm.icns" \
--window-pos 200 120 \
--window-size 600 400 \
--icon-size 100 \
--icon "cterm.app" 150 185 \
--hide-extension "cterm.app" \
--app-drop-link 450 185 \
"release/cterm-macos-$VERSION.dmg" \
"release/cterm.app" || true
# Fallback if create-dmg fails (e.g., no icon file)
if [ ! -f "release/cterm-macos-$VERSION.dmg" ]; then
# Simple DMG creation
mkdir -p release/dmg-contents
cp -R release/cterm.app release/dmg-contents/
ln -s /Applications release/dmg-contents/Applications
hdiutil create -volname "cterm $VERSION" -srcfolder release/dmg-contents -ov -format UDZO "release/cterm-macos-$VERSION.dmg"
fi
# Rename to standard name for artifact
mv "release/cterm-macos-$VERSION.dmg" "release/cterm-macos-universal.dmg"
- name: Sign and notarize DMG
if: env.APPLE_CERTIFICATE_BASE64 != ''
env:
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
run: |
IDENTITY=$(security find-identity -v -p codesigning | grep "Developer ID Application" | head -1 | sed 's/.*"\(.*\)".*/\1/')
# Sign the DMG
codesign --force --sign "$IDENTITY" --timestamp "release/cterm-macos-universal.dmg"
# Notarize the DMG
xcrun notarytool submit "release/cterm-macos-universal.dmg" \
--apple-id "$APPLE_ID" \
--password "$APPLE_ID_PASSWORD" \
--team-id "$APPLE_TEAM_ID" \
--wait --timeout 30m
# Staple the notarization ticket to the DMG
xcrun stapler staple "release/cterm-macos-universal.dmg"
- name: Sign ctermd binary
if: env.APPLE_CERTIFICATE_BASE64 != ''
env:
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
IDENTITY=$(security find-identity -v -p codesigning | grep "Developer ID Application" | head -1 | sed 's/.*"\(.*\)".*/\1/')
codesign --force --options runtime \
--sign "$IDENTITY" \
--timestamp \
"universal-binary/ctermd"
codesign --verify --strict --verbose=2 "universal-binary/ctermd"
- name: Clean up keychain
if: always()
run: |
KEYCHAIN_PATH="/tmp/signing.keychain-db"
if [ -f "$KEYCHAIN_PATH" ]; then
security delete-keychain "$KEYCHAIN_PATH" || true
fi
- name: Create tar.gz for auto-update (app bundle)
run: |
# Create tar.gz of the full app bundle for auto-update
# This includes the icon, Info.plist, and binary
cd release && tar -czvf cterm-macos-universal.tar.gz cterm.app
- name: Create ctermd tar.gz
run: |
mkdir -p release/ctermd-macos-universal
cp universal-binary/ctermd release/ctermd-macos-universal/
cp README.md LICENSE release/ctermd-macos-universal/
cd release && tar -czvf ctermd-macos-universal.tar.gz ctermd-macos-universal
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: cterm-macos-dmg
path: release/cterm-macos-universal.dmg
- name: Upload tar.gz artifact
uses: actions/upload-artifact@v4
with:
name: cterm-macos-universal
path: release/cterm-macos-universal.tar.gz
- name: Upload ctermd tar.gz artifact
uses: actions/upload-artifact@v4
with:
name: ctermd-macos-universal
path: release/ctermd-macos-universal.tar.gz
release:
name: Create Release
needs: [build-linux, build-linux-arm64, build-windows, build-macos-arm]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/cterm-linux-x86_64/cterm-linux-x86_64.tar.gz
artifacts/cterm-linux-arm64/cterm-linux-arm64.tar.gz
artifacts/cterm-windows-x86_64/cterm-windows-x86_64.zip
artifacts/cterm-windows-installer/cterm-windows-x86_64-setup.exe
artifacts/cterm-macos-universal/cterm-macos-universal.tar.gz
artifacts/cterm-macos-dmg/cterm-macos-universal.dmg
artifacts/ctermd-linux-x86_64/ctermd-linux-x86_64.tar.gz
artifacts/ctermd-linux-arm64/ctermd-linux-arm64.tar.gz
artifacts/ctermd-windows-x86_64/ctermd-windows-x86_64.zip
artifacts/ctermd-macos-universal/ctermd-macos-universal.tar.gz
draft: false
prerelease: false
generate_release_notes: true