Attempt to fix mac installer #208
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build ceramic | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - v** | |
| jobs: | |
| build-ceramic-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Checkout submodules | |
| run: git submodule update --init --recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Setup Haxe | |
| working-directory: . | |
| run: | | |
| $NEKOPATH = $(Convert-Path .)+'/git/haxe-binary/windows/neko' | |
| $HAXEPATH = $(Convert-Path .)+'/git/haxe-binary/windows/haxe' | |
| echo $NEKOPATH >> $GITHUB_PATH | |
| echo $HAXEPATH >> $GITHUB_PATH | |
| echo $NEKOPATH | |
| echo $HAXEPATH | |
| - name: Build ceramic | |
| working-directory: . | |
| run: | | |
| cd tools | |
| node ./install --ceramic-release | |
| cd ../runner | |
| npm ci | |
| cd .. | |
| - name: Cleanup | |
| working-directory: . | |
| run: | | |
| Remove-Item 'git/haxe-binary/linux-x86_64' -Recurse | |
| Remove-Item 'git/haxe-binary/linux-arm64' -Recurse | |
| Remove-Item 'git/haxe-binary/mac' -Recurse | |
| cd tools | |
| Remove-Item './haxe' | |
| Remove-Item './haxelib' | |
| Remove-Item './neko' | |
| cd .. | |
| - name: Run ceramic | |
| working-directory: ./tools | |
| run: | | |
| ./ceramic | |
| - name: Check ceramic version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./tools | |
| run: | | |
| $GIT_TAG = $($env:GITHUB_REF).replace("refs/tags/", "") | |
| ./ceramic version --check-tag $GIT_TAG | |
| # First create the zip as before - we want both | |
| - name: Create zip archive | |
| working-directory: . | |
| run: | | |
| $ZIP_COMPRESS = $(Convert-Path .) | |
| $ZIP_EXCLUDE = @(".git", ".github", "ceramic-windows.zip", "git/loreline/git", "tools/build") | |
| $ZIP_DESTINATION = 'ceramic-windows.zip' | |
| $ZIP_FILES = Get-ChildItem -Path $ZIP_COMPRESS -Exclude $ZIP_EXCLUDE | |
| Compress-Archive -Path $ZIP_FILES -DestinationPath $ZIP_DESTINATION -CompressionLevel Optimal | |
| # Then add the Inno Setup steps | |
| - name: Install Inno Setup | |
| run: | | |
| choco install innosetup -y | |
| - name: Convert PNG to ICO | |
| run: | | |
| # Install the ImageMagick package which includes the convert tool | |
| choco install imagemagick -y | |
| # Create the icon file | |
| $iconDir = "tools\resources" | |
| $iconPath = "$iconDir\AppIcon-flat.ico" | |
| Write-Host "Checking for PNG file..." | |
| if (Test-Path "$iconDir\AppIcon-flat.png") { | |
| Write-Host "Converting PNG to ICO..." | |
| # Use magick command (newer ImageMagick) - convert multiple sizes in one command | |
| magick convert "$iconDir\AppIcon-flat.png" -define icon:auto-resize=64,48,32,16 "$iconPath" | |
| if (Test-Path $iconPath) { | |
| Write-Host "Successfully created icon at $iconPath" | |
| } else { | |
| Write-Host "Failed to create icon at $iconPath" | |
| } | |
| } else { | |
| Write-Host "PNG file not found at $iconDir\AppIcon-flat.png" | |
| } | |
| - name: Create Inno Setup Script | |
| run: | | |
| $GIT_TAG = "" | |
| if ("$env:GITHUB_REF".StartsWith("refs/tags/")) { | |
| $GIT_TAG = $($env:GITHUB_REF).replace("refs/tags/", "") | |
| } else { | |
| $GIT_TAG = "dev-build" | |
| } | |
| $Version = $GIT_TAG -replace "v", "" | |
| # Verify existing files | |
| Write-Host "Checking for LICENSE file..." | |
| if (Test-Path "LICENSE") { | |
| Write-Host "LICENSE file found." | |
| } else { | |
| Write-Host "Warning: LICENSE file not found." | |
| } | |
| # Ensure icon file exists | |
| Write-Host "Checking for icon file..." | |
| $iconPath = "tools\resources\AppIcon-flat.ico" | |
| if (Test-Path $iconPath) { | |
| Write-Host "Icon file found at: $iconPath" | |
| } else { | |
| Write-Host "Warning: Icon file not found at $iconPath" | |
| } | |
| # List files in current directory for debugging | |
| Write-Host "Files in root directory:" | |
| Get-ChildItem -Path . -Force | ForEach-Object { Write-Host $_.Name } | |
| $innoSetupScript = @" | |
| ; Script generated by Ceramic build process | |
| #define MyAppName "Ceramic Engine" | |
| #define MyAppVersion "$Version" | |
| #define MyAppPublisher "Ceramic Engine" | |
| #define MyAppURL "https://ceramic-engine.com" | |
| #define MyAppExeName "ceramic.cmd" | |
| #define SourceDir "$env:GITHUB_WORKSPACE" | |
| [Setup] | |
| ; NOTE: The value of AppId uniquely identifies this application. | |
| ; Do not use the same AppId value in installers for other applications. | |
| AppId={{FAD9F6C1-3A23-4FB8-A6FE-C5C2A5C730E5}} | |
| AppName={#MyAppName} | |
| AppVersion={#MyAppVersion} | |
| AppVerName={#MyAppName} {#MyAppVersion} | |
| AppPublisher={#MyAppPublisher} | |
| AppPublisherURL={#MyAppURL} | |
| AppSupportURL={#MyAppURL} | |
| AppUpdatesURL={#MyAppURL} | |
| DefaultDirName={userappdata}\ceramic | |
| DefaultGroupName={#MyAppName} | |
| DisableProgramGroupPage=yes | |
| OutputDir={#SourceDir} | |
| OutputBaseFilename=ceramic-windows-installer | |
| SetupIconFile={#SourceDir}\tools\resources\AppIcon-flat.ico | |
| Compression=lzma | |
| SolidCompression=yes | |
| PrivilegesRequired=admin | |
| ChangesEnvironment=yes | |
| WizardStyle=modern | |
| [Languages] | |
| Name: "english"; MessagesFile: "compiler:Default.isl" | |
| [Tasks] | |
| Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; | |
| [Files] | |
| Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: ".git\*,.github\*,ceramic-windows.zip,ceramic-windows-installer.exe,git\loreline\git\*,tools\build\*" | |
| Source: "{#SourceDir}\tools\resources\AppIcon-flat.ico"; DestDir: "{app}\tools\resources"; Flags: ignoreversion | |
| [Icons] | |
| Name: "{group}\{#MyAppName}"; Filename: "{app}\tools\{#MyAppExeName}"; IconFilename: "{app}\tools\resources\AppIcon-flat.ico" | |
| Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\tools\resources\AppIcon-flat.ico" | |
| Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\tools\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\tools\resources\AppIcon-flat.ico" | |
| [Code] | |
| // Check if Haxe is installed | |
| function InitializeSetup(): Boolean; | |
| var | |
| ErrorCode: Integer; | |
| HaxeInstalled: Boolean; | |
| ResultString: String; | |
| begin | |
| HaxeInstalled := False; | |
| // Try to execute 'haxe --version' to check if Haxe is installed | |
| if Exec('where', 'haxe', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then | |
| begin | |
| HaxeInstalled := (ErrorCode = 0); | |
| end; | |
| // If Haxe is not installed, show a message and abort | |
| if not HaxeInstalled then | |
| begin | |
| MsgBox('Haxe is not installed or not in your PATH.' + #13#10 + #13#10 + | |
| 'Please install Haxe before installing Ceramic.', mbError, MB_OK); | |
| Result := False; | |
| end | |
| else | |
| begin | |
| Result := True; | |
| end; | |
| end; | |
| // Run ceramic link after installation | |
| procedure CurStepChanged(CurStep: TSetupStep); | |
| var | |
| ResultCode: Integer; | |
| begin | |
| if CurStep = ssPostInstall then | |
| begin | |
| Exec(ExpandConstant('{app}\tools\ceramic.cmd'), 'link', '', SW_SHOW, ewWaitUntilTerminated, ResultCode); | |
| if ResultCode <> 0 then | |
| begin | |
| MsgBox('Warning: Failed to run "ceramic link". You may need to run it manually.', mbInformation, MB_OK); | |
| end; | |
| end; | |
| end; | |
| // Run ceramic unlink before uninstallation | |
| procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); | |
| var | |
| ResultCode: Integer; | |
| begin | |
| if CurUninstallStep = usUninstall then | |
| begin | |
| Exec(ExpandConstant('{app}\tools\ceramic.cmd'), 'unlink', '', SW_SHOW, ewWaitUntilTerminated, ResultCode); | |
| if ResultCode <> 0 then | |
| begin | |
| MsgBox('Warning: Failed to run "ceramic unlink". Your PATH environment variable may need manual cleanup.', mbInformation, MB_OK); | |
| end; | |
| end; | |
| end; | |
| "@ | |
| Set-Content -Path "setup.iss" -Value $innoSetupScript | |
| - name: Build Windows Installer | |
| run: | | |
| # Find Inno Setup compiler | |
| $isccPath = if (Test-Path "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe") { | |
| "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| } elseif (Test-Path "${env:ProgramFiles}\Inno Setup 6\ISCC.exe") { | |
| "${env:ProgramFiles}\Inno Setup 6\ISCC.exe" | |
| } else { | |
| # Try to find ISCC.exe in common locations | |
| $potentialPaths = @( | |
| "C:\Program Files\Inno Setup 6\ISCC.exe", | |
| "C:\Program Files (x86)\Inno Setup 6\ISCC.exe", | |
| (Get-Command "ISCC.exe" -ErrorAction SilentlyContinue).Source | |
| ) | |
| $foundPath = $null | |
| foreach ($path in $potentialPaths) { | |
| if ($path -and (Test-Path $path)) { | |
| $foundPath = $path | |
| break | |
| } | |
| } | |
| if (-not $foundPath) { | |
| Write-Error "Cannot find ISCC.exe. Make sure Inno Setup is properly installed." | |
| exit 1 | |
| } | |
| $foundPath | |
| } | |
| Write-Host "Using Inno Setup at: $isccPath" | |
| # Build installer | |
| & $isccPath setup.iss | |
| - name: Upload ZIP | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 7 | |
| name: ceramic-windows.zip | |
| path: ceramic-windows.zip | |
| compression-level: 0 | |
| - name: Upload Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 7 | |
| name: ceramic-windows-installer.exe | |
| path: ceramic-windows-installer.exe | |
| if-no-files-found: warn | |
| build-ceramic-mac: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Checkout submodules | |
| run: git submodule update --init --recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Setup Haxe | |
| working-directory: . | |
| run: | | |
| set -ex | |
| export NEKOPATH=$PWD'/git/haxe-binary/mac/neko' | |
| export HAXEPATH=$PWD'/git/haxe-binary/mac/haxe' | |
| echo 'neko path: '$NEKOPATH | |
| echo 'haxe path: '$HAXEPATH | |
| sudo mkdir -p /usr/local/bin | |
| sudo mkdir -p /usr/local/lib | |
| sudo mkdir -p /usr/local/share/haxe | |
| sudo ln -s $HAXEPATH/haxe /usr/local/bin/haxe | |
| sudo ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib | |
| sudo ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin | |
| sudo ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin | |
| sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std | |
| sudo ln -s $NEKOPATH/neko /usr/local/bin/neko | |
| sudo ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc | |
| sudo ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml | |
| sudo ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools | |
| sudo ln -s $NEKOPATH /usr/local/lib/neko | |
| sudo ln -s $NEKOPATH/libneko.dylib /usr/local/lib/libneko.dylib | |
| sudo ln -s $NEKOPATH/libneko.2.4.0.dylib /usr/local/lib/libneko.2.4.0.dylib | |
| sudo ln -s $NEKOPATH/libneko.2.dylib /usr/local/lib/libneko.2.dylib | |
| set +x | |
| echo 'neko: '$(neko -version) | |
| echo 'haxe: '$(haxe --version) | |
| - name: Build ceramic | |
| working-directory: . | |
| run: | | |
| cd tools | |
| node ./install --ceramic-release | |
| cd ../runner | |
| npm ci | |
| cd .. | |
| - name: Cleanup | |
| working-directory: . | |
| run: | | |
| rm -rf git/haxe-binary/linux-x86_64 | |
| rm -rf git/haxe-binary/linux-arm64 | |
| rm -rf git/haxe-binary/windows | |
| rm -rf git/loreline/git | |
| cd tools | |
| rm -f ./haxe.cmd | |
| rm -f ./neko.cmd | |
| rm -f ./ceramic.cmd | |
| cd .. | |
| - name: Run ceramic | |
| working-directory: ./tools | |
| run: | | |
| ./ceramic | |
| - name: Check ceramic version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./tools | |
| run: | | |
| GIT_TAG=${GITHUB_REF/refs\/tags\//} | |
| ./ceramic version --check-tag $GIT_TAG | |
| # First create the zip as before | |
| - name: Create zip archive | |
| run: zip --symlinks -9 -r 'ceramic-mac.zip' . -x ".git/*" ".github/*" "tools/build/*" | |
| # Then add the installer steps | |
| - name: Create directory structure for package | |
| run: | | |
| mkdir -p package_root/usr/local/lib/ceramic | |
| cp -R * package_root/usr/local/lib/ceramic/ | |
| rm -rf package_root/usr/local/lib/ceramic/.git package_root/usr/local/lib/ceramic/.github package_root/usr/local/lib/ceramic/package_root package_root/usr/local/lib/ceramic/ceramic-mac.zip package_root/usr/local/lib/ceramic/ceramic-mac-installer.pkg package_root/usr/local/lib/ceramic/tools/build | |
| # Create uninstall script | |
| mkdir -p package_root/usr/local/bin | |
| cat > package_root/usr/local/bin/ceramic-uninstall << 'EOF' | |
| #!/bin/bash | |
| echo "Uninstalling Ceramic Engine..." | |
| # Remove the ceramic wrapper script | |
| if [ -f "/usr/local/bin/ceramic" ]; then | |
| echo "Removing ceramic command..." | |
| sudo rm -f "/usr/local/bin/ceramic" | |
| fi | |
| # Remove installation directory | |
| if [ -d "/usr/local/lib/ceramic" ]; then | |
| echo "Removing Ceramic installation directory..." | |
| sudo rm -rf "/usr/local/lib/ceramic" | |
| fi | |
| # Remove the uninstall script itself | |
| if [ -f "/usr/local/bin/ceramic-uninstall" ]; then | |
| echo "Removing uninstall script..." | |
| sudo rm -f "/usr/local/bin/ceramic-uninstall" | |
| fi | |
| echo "Ceramic has been successfully uninstalled." | |
| echo "To uninstall this script, run: sudo rm -f /usr/local/bin/ceramic-uninstall" | |
| EOF | |
| chmod +x package_root/usr/local/bin/ceramic-uninstall | |
| - name: Create scripts directory | |
| run: | | |
| mkdir -p scripts | |
| - name: Create postinstall script | |
| run: | | |
| cat > scripts/postinstall << 'EOF' | |
| #!/bin/bash | |
| # Function to log errors with more detail | |
| log_error() { | |
| echo "ERROR: $1" >&2 | |
| logger -t ceramic-installer "ERROR: $1" | |
| } | |
| # Function to log info | |
| log_info() { | |
| echo "INFO: $1" | |
| logger -t ceramic-installer "INFO: $1" | |
| } | |
| log_info "Starting Ceramic Engine installation..." | |
| # Check if we're running as root (required for system installation) | |
| if [ "$EUID" -ne 0 ]; then | |
| log_error "This installer must be run as root (use sudo)" | |
| exit 1 | |
| fi | |
| # Check if Haxe is installed | |
| if ! command -v haxe &> /dev/null; then | |
| log_error "Haxe is not installed or not in PATH. Please install Haxe before installing Ceramic." | |
| log_error "You can download Haxe from: https://haxe.org/download/" | |
| exit 1 | |
| fi | |
| log_info "Haxe found: $(haxe --version 2>&1)" | |
| # Verify that the installation files exist | |
| if [ ! -d "/usr/local/lib/ceramic" ]; then | |
| log_error "Installation files not found at /usr/local/lib/ceramic" | |
| exit 1 | |
| fi | |
| if [ ! -f "/usr/local/lib/ceramic/tools/ceramic" ]; then | |
| log_error "Ceramic executable not found at /usr/local/lib/ceramic/tools/ceramic" | |
| exit 1 | |
| fi | |
| # Make sure the ceramic executable is executable | |
| chmod +x "/usr/local/lib/ceramic/tools/ceramic" | |
| if [ $? -ne 0 ]; then | |
| log_error "Failed to make ceramic executable" | |
| exit 1 | |
| fi | |
| # Remove existing ceramic wrapper if it exists | |
| if [ -f "/usr/local/bin/ceramic" ]; then | |
| log_info "Removing existing ceramic wrapper..." | |
| rm -f "/usr/local/bin/ceramic" | |
| if [ $? -ne 0 ]; then | |
| log_error "Failed to remove existing ceramic wrapper" | |
| exit 1 | |
| fi | |
| fi | |
| # Create the ceramic wrapper script | |
| log_info "Creating ceramic wrapper script at /usr/local/bin/ceramic..." | |
| cat > /usr/local/bin/ceramic << 'WRAPPER_EOF' | |
| #!/bin/bash | |
| /usr/local/lib/ceramic/tools/ceramic "$@" | |
| WRAPPER_EOF | |
| if [ $? -ne 0 ]; then | |
| log_error "Failed to create ceramic wrapper script" | |
| exit 1 | |
| fi | |
| # Make the wrapper executable | |
| chmod +x /usr/local/bin/ceramic | |
| if [ $? -ne 0 ]; then | |
| log_error "Failed to make ceramic wrapper executable" | |
| exit 1 | |
| fi | |
| # Test that the wrapper works | |
| log_info "Testing ceramic installation..." | |
| if ! /usr/local/bin/ceramic --version >/dev/null 2>&1; then | |
| log_error "Ceramic installation test failed - ceramic command is not working properly" | |
| exit 1 | |
| fi | |
| # Make uninstall script executable | |
| if [ -f "/usr/local/bin/ceramic-uninstall" ]; then | |
| chmod +x "/usr/local/bin/ceramic-uninstall" | |
| fi | |
| log_info "Ceramic Engine has been successfully installed!" | |
| log_info "You can now run 'ceramic' from anywhere in your terminal" | |
| log_info "To uninstall, run: ceramic-uninstall" | |
| exit 0 | |
| EOF | |
| chmod +x scripts/postinstall | |
| - name: Create preinstall script | |
| run: | | |
| cat > scripts/preinstall << 'EOF' | |
| #!/bin/bash | |
| # Function to log info | |
| log_info() { | |
| echo "INFO: $1" | |
| logger -t ceramic-installer "INFO: $1" | |
| } | |
| log_info "Preparing for Ceramic Engine installation..." | |
| # Check if we're running as root | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "ERROR: This installer must be run as root" >&2 | |
| exit 1 | |
| fi | |
| # Create directories if they don't exist | |
| mkdir -p /usr/local/lib | |
| mkdir -p /usr/local/bin | |
| # Remove existing installation if it exists | |
| if [ -d "/usr/local/lib/ceramic" ]; then | |
| log_info "Removing existing Ceramic installation..." | |
| rm -rf "/usr/local/lib/ceramic" | |
| fi | |
| if [ -f "/usr/local/bin/ceramic" ]; then | |
| log_info "Removing existing ceramic command..." | |
| rm -f "/usr/local/bin/ceramic" | |
| fi | |
| exit 0 | |
| EOF | |
| chmod +x scripts/preinstall | |
| - name: Create distribution.xml | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/* ]]; then | |
| GIT_TAG=${GITHUB_REF/refs\/tags\//} | |
| VERSION=${GIT_TAG/v/} | |
| else | |
| VERSION="dev-build" | |
| fi | |
| cat > distribution.xml << EOF | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <installer-gui-script minSpecVersion="1"> | |
| <title>Ceramic Engine</title> | |
| <organization>ceramic-engine</organization> | |
| <domains enable_localSystem="true"/> | |
| <options customize="never" require-scripts="true"/> | |
| <background file="background.png" scaling="proportional" alignment="center"/> | |
| <welcome file="welcome.html" mime-type="text/html"/> | |
| <conclusion file="conclusion.html" mime-type="text/html"/> | |
| <pkg-ref id="com.ceramic-engine.ceramic"/> | |
| <choices-outline> | |
| <line choice="default"> | |
| <line choice="com.ceramic-engine.ceramic"/> | |
| </line> | |
| </choices-outline> | |
| <choice id="default"/> | |
| <choice id="com.ceramic-engine.ceramic" visible="false"> | |
| <pkg-ref id="com.ceramic-engine.ceramic"/> | |
| </choice> | |
| <pkg-ref id="com.ceramic-engine.ceramic" version="${VERSION}" onConclusion="none">ceramic.pkg</pkg-ref> | |
| </installer-gui-script> | |
| EOF | |
| - name: Create welcome.html | |
| run: | | |
| cat > welcome.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Welcome to Ceramic Engine Installer</title> | |
| <style> | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | |
| padding: 20px; | |
| } | |
| .requirement { | |
| background-color: #f0f0f0; | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin: 10px 0; | |
| } | |
| .warning { | |
| background-color: #fff3cd; | |
| border: 1px solid #ffeaa7; | |
| color: #856404; | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin: 10px 0; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Welcome to Ceramic Engine!</h2> | |
| <p>This installer will install Ceramic Engine on your system.</p> | |
| <h3>Installation Details:</h3> | |
| <ul> | |
| <li>Ceramic will be installed to <code>/usr/local/lib/ceramic</code></li> | |
| <li>A <code>ceramic</code> command will be created in <code>/usr/local/bin</code></li> | |
| <li>Administrator privileges are required for installation</li> | |
| </ul> | |
| <div class="requirement"> | |
| <h3>Requirements:</h3> | |
| <p><strong>Haxe must be installed and available in your PATH.</strong></p> | |
| <p>If you don't have Haxe installed, please download it from: <a href="https://haxe.org/download/">https://haxe.org/download/</a></p> | |
| </div> | |
| <div class="warning"> | |
| <p><strong>Note:</strong> If you have a previous installation of Ceramic, it will be removed during installation.</p> | |
| </div> | |
| <p>To uninstall Ceramic later, run <code>ceramic-uninstall</code> in Terminal.</p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Create conclusion.html | |
| run: | | |
| cat > conclusion.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Installation Complete</title> | |
| <style> | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | |
| padding: 20px; | |
| } | |
| .success { | |
| background-color: #d4edda; | |
| border: 1px solid #c3e6cb; | |
| color: #155724; | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin: 10px 0; | |
| } | |
| code { | |
| background-color: #f8f9fa; | |
| padding: 2px 6px; | |
| border-radius: 3px; | |
| font-family: monospace; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="success"> | |
| <h2>🎉 Installation Complete!</h2> | |
| <p>Ceramic Engine has been successfully installed!</p> | |
| </div> | |
| <h3>Getting Started:</h3> | |
| <ul> | |
| <li>Open Terminal and run <code>ceramic</code> to get started</li> | |
| <li>Run <code>ceramic --help</code> to see available commands</li> | |
| <li>Run <code>ceramic --version</code> to verify your installation</li> | |
| </ul> | |
| <h3>Installation Details:</h3> | |
| <ul> | |
| <li>Ceramic is installed at: <code>/usr/local/lib/ceramic</code></li> | |
| <li>Command available at: <code>/usr/local/bin/ceramic</code></li> | |
| </ul> | |
| <h3>Uninstalling:</h3> | |
| <p>To uninstall Ceramic, run <code>ceramic-uninstall</code> in Terminal.</p> | |
| <h3>Need Help?</h3> | |
| <p>Visit the Ceramic Engine documentation for guides and examples.</p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Create background image | |
| run: | | |
| # Create a background image using the Ceramic logo | |
| cp tools/resources/AppIcon-flat.png background_orig.png | |
| # Resize to appropriate dimensions for installer background | |
| sips -z 540 540 background_orig.png --out background.png | |
| - name: Build component package | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/* ]]; then | |
| GIT_TAG=${GITHUB_REF/refs\/tags\//} | |
| VERSION=${GIT_TAG/v/} | |
| else | |
| VERSION="dev-build" | |
| fi | |
| pkgbuild --root package_root --identifier com.ceramic-engine.ceramic --version "$VERSION" --scripts scripts ceramic.pkg | |
| - name: Build product archive | |
| run: | | |
| productbuild --distribution distribution.xml --resources . --package-path . ceramic-mac-installer.pkg | |
| - name: Upload ZIP | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 7 | |
| name: ceramic-mac.zip | |
| path: ceramic-mac.zip | |
| compression-level: 0 | |
| - name: Upload Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 7 | |
| name: ceramic-mac-installer.pkg | |
| path: ceramic-mac-installer.pkg | |
| compression-level: 0 | |
| build-ceramic-linux: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: "ubuntu-22.04" | |
| arch: "x86_64" | |
| - os: "ubuntu-22.04-arm" | |
| arch: "arm64" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Checkout submodules | |
| run: git submodule update --init --recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Setup Haxe | |
| working-directory: . | |
| run: | | |
| export NEKOPATH=$PWD'/git/haxe-binary/linux-${{ matrix.arch }}/neko' | |
| export HAXEPATH=$PWD'/git/haxe-binary/linux-${{ matrix.arch }}/haxe' | |
| echo 'neko path: '$NEKOPATH | |
| echo 'haxe path: '$HAXEPATH | |
| sudo mkdir -p /usr/local/bin | |
| sudo mkdir -p /usr/local/lib | |
| sudo mkdir -p /usr/local/share/haxe | |
| sudo ln -s $HAXEPATH/haxe /usr/local/bin/haxe | |
| sudo ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib | |
| sudo ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin | |
| sudo ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin | |
| sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std | |
| sudo ln -s $NEKOPATH/neko /usr/local/bin/neko | |
| sudo ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc | |
| sudo ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml | |
| sudo ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools | |
| sudo ln -s $NEKOPATH /usr/local/lib/neko | |
| sudo ln -s $NEKOPATH/libneko.so /usr/local/lib/libneko.so | |
| sudo ln -s $NEKOPATH/libneko.so.2.4.0 /usr/local/lib/libneko.so.2.4.0 | |
| sudo ln -s $NEKOPATH/libneko.so.2 /usr/local/lib/libneko.so.2 | |
| sudo ldconfig | |
| sudo ldconfig /usr/local/lib | |
| echo 'neko: '$(neko -version) | |
| echo 'haxe: '$(haxe --version) | |
| - name: Build ceramic | |
| working-directory: . | |
| run: | | |
| cd tools | |
| node ./install --ceramic-release | |
| cd ../runner | |
| npm ci | |
| cd .. | |
| - name: Cleanup | |
| working-directory: . | |
| run: | | |
| rm -rf git/haxe-binary/mac | |
| if [ ${{ matrix.arch == 'x86_64' }}]; then | |
| rm -rf git/haxe-binary/linux-arm64 | |
| else | |
| rm -rf git/haxe-binary/linux-x86_64 | |
| fi | |
| rm -rf git/haxe-binary/windows | |
| rm -rf git/loreline/git | |
| cd tools | |
| rm -f ./haxe.cmd | |
| rm -f ./neko.cmd | |
| rm -f ./ceramic.cmd | |
| cd .. | |
| - name: Run ceramic | |
| working-directory: ./tools | |
| run: | | |
| ./ceramic | |
| - name: Check ceramic version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./tools | |
| run: | | |
| GIT_TAG=${GITHUB_REF/refs\/tags\//} | |
| ./ceramic version --check-tag $GIT_TAG | |
| - name: Create zip archive | |
| run: zip --symlinks -9 -r 'ceramic-linux-${{ matrix.arch }}.zip' . -x ".git/*" ".github/*" "tools/build/*" | |
| - name: Upload Files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 7 | |
| name: ceramic-linux-${{ matrix.arch }}.zip | |
| path: ceramic-linux-${{ matrix.arch }}.zip | |
| compression-level: 0 | |
| create-release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [build-ceramic-windows, build-ceramic-mac, build-ceramic-linux] | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Download both installers and zip files | |
| - name: Download ceramic-windows-installer.exe | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ceramic-windows-installer.exe | |
| path: . | |
| - name: Download ceramic-windows.zip | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ceramic-windows.zip | |
| path: . | |
| - name: Download ceramic-mac-installer.pkg | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ceramic-mac-installer.pkg | |
| path: . | |
| - name: Download ceramic-mac.zip | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ceramic-mac.zip | |
| path: . | |
| - name: Download ceramic-linux-x86_64.zip | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ceramic-linux-x86_64.zip | |
| path: . | |
| - name: Download ceramic-linux-arm64.zip | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ceramic-linux-arm64.zip | |
| path: . | |
| - name: Extract tag name | |
| id: extract_tag | |
| run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref }} | |
| name: Ceramic ${{ env.TAG_NAME }} | |
| body: | | |
| Ceramic ${{ env.TAG_NAME }} | |
| ## Installation Options | |
| ### Windows | |
| - **Installer**: Download and run `ceramic-windows-installer.exe` to install Ceramic in your home directory | |
| - **Manual**: Download and extract `ceramic-windows.zip` to a location of your choice | |
| ### macOS | |
| - **Installer**: Download and open `ceramic-mac-installer.pkg` to install Ceramic system-wide at `/usr/local/lib/ceramic` | |
| - **Manual**: Download and extract `ceramic-mac.zip` to a location of your choice | |
| ### Linux | |
| - Download and extract the appropriate zip file for your architecture: | |
| - `ceramic-linux-x86_64.zip` for 64-bit x86 systems | |
| - `ceramic-linux-arm64.zip` for ARM64 systems | |
| draft: false | |
| prerelease: false | |
| files: | | |
| ceramic-windows-installer.exe | |
| ceramic-windows.zip | |
| ceramic-mac-installer.pkg | |
| ceramic-mac.zip | |
| ceramic-linux-x86_64.zip | |
| ceramic-linux-arm64.zip | |
| generate-api-docs: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [create-release] | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Dispatch event | |
| uses: ceramic-engine/repository-dispatch@v1 | |
| with: | |
| token: ${{ secrets.PAT_PUBLIC }} | |
| repository: ceramic-engine/api-docs | |
| event-type: deploy-api-docs | |
| client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |