[docs] Disable headless and unity backend docs to prevent conflicts i… #266
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: . | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd tools | |
| node ./install --ceramic-release | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| cd ../runner | |
| npm ci | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| 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: | | |
| # Use maximum ZIP compression level | |
| 7z a -tzip ceramic-windows.zip * ` | |
| "-x!.git" ` | |
| "-x!.github" ` | |
| "-x!ceramic-windows.zip" ` | |
| "-x!ceramic-windows-installer.exe" ` | |
| "-x!git\loreline\git" ` | |
| "-x!tools\build" ` | |
| -mx=9 | |
| # 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" | |
| #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={sd}\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: . | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -e | |
| 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/uninstall-ceramic << 'EOF' | |
| #!/bin/bash | |
| echo "Uninstalling Ceramic..." | |
| # 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/uninstall-ceramic" ]; then | |
| echo "Removing uninstall script..." | |
| sudo rm -f "/usr/local/bin/uninstall-ceramic" | |
| fi | |
| echo "Ceramic has been successfully uninstalled." | |
| EOF | |
| chmod +x package_root/usr/local/bin/uninstall-ceramic | |
| - name: Create scripts directory | |
| run: | | |
| mkdir -p scripts | |
| - name: Create postinstall script | |
| run: | | |
| cat > scripts/postinstall << 'EOF' | |
| #!/bin/bash | |
| # Redirect all output to log file for debugging | |
| exec 1>/tmp/ceramic-install.log 2>&1 | |
| echo "Starting Ceramic installation..." | |
| echo "Running as user: $(whoami)" | |
| echo "Current working directory: $(pwd)" | |
| echo "Original PATH: $PATH" | |
| # Add common locations to PATH for checking dependencies | |
| export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH" | |
| echo "Updated PATH: $PATH" | |
| # Check if Haxe is installed in common locations | |
| HAXE_FOUND=false | |
| HAXE_PATH="" | |
| # Check common Haxe installation locations | |
| for haxe_location in "/usr/local/bin/haxe" "/opt/homebrew/bin/haxe" "$(which haxe 2>/dev/null)"; do | |
| if [ -n "$haxe_location" ] && [ -f "$haxe_location" ] && [ -x "$haxe_location" ]; then | |
| echo "Found Haxe at: $haxe_location" | |
| HAXE_FOUND=true | |
| HAXE_PATH="$haxe_location" | |
| break | |
| fi | |
| done | |
| if [ "$HAXE_FOUND" = false ]; then | |
| echo "ERROR: Haxe is not installed or not found in common locations" | |
| echo "Checked locations: /usr/local/bin/haxe, /opt/homebrew/bin/haxe" | |
| echo "Please install Haxe from: https://haxe.org/download/" | |
| echo "Make sure it's installed to /usr/local/bin/haxe or /opt/homebrew/bin/haxe" | |
| exit 1 | |
| fi | |
| echo "Testing Haxe installation..." | |
| HAXE_VERSION=$($HAXE_PATH --version 2>&1 || echo 'version check failed') | |
| echo "Haxe version: $HAXE_VERSION" | |
| # Verify that the installation files exist | |
| if [ ! -d "/usr/local/lib/ceramic" ]; then | |
| echo "ERROR: Installation files not found at /usr/local/lib/ceramic" | |
| echo "Contents of /usr/local/lib:" | |
| ls -la /usr/local/lib/ || echo "Cannot list /usr/local/lib" | |
| exit 1 | |
| fi | |
| if [ ! -f "/usr/local/lib/ceramic/tools/ceramic" ]; then | |
| echo "ERROR: Ceramic executable not found at /usr/local/lib/ceramic/tools/ceramic" | |
| echo "Contents of /usr/local/lib/ceramic:" | |
| ls -la /usr/local/lib/ceramic/ || echo "Cannot list ceramic directory" | |
| if [ -d "/usr/local/lib/ceramic/tools" ]; then | |
| echo "Contents of /usr/local/lib/ceramic/tools:" | |
| ls -la /usr/local/lib/ceramic/tools/ || echo "Cannot list tools directory" | |
| fi | |
| exit 1 | |
| fi | |
| # Make sure the ceramic executable is executable | |
| echo "Making ceramic executable..." | |
| chmod +x "/usr/local/lib/ceramic/tools/ceramic" | |
| if [ $? -ne 0 ]; then | |
| echo "ERROR: Failed to make ceramic executable" | |
| exit 1 | |
| fi | |
| # Remove existing ceramic wrapper if it exists | |
| if [ -f "/usr/local/bin/ceramic" ]; then | |
| echo "Removing existing ceramic wrapper..." | |
| rm -f "/usr/local/bin/ceramic" | |
| fi | |
| # Create the ceramic wrapper script | |
| echo "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 | |
| echo "ERROR: Failed to create ceramic wrapper script" | |
| exit 1 | |
| fi | |
| # Make the wrapper executable | |
| echo "Making ceramic wrapper executable..." | |
| chmod +x /usr/local/bin/ceramic | |
| if [ $? -ne 0 ]; then | |
| echo "ERROR: Failed to make ceramic wrapper executable" | |
| exit 1 | |
| fi | |
| # Make uninstall script executable | |
| if [ -f "/usr/local/bin/uninstall-ceramic" ]; then | |
| chmod +x "/usr/local/bin/uninstall-ceramic" | |
| echo "Uninstall script made executable" | |
| fi | |
| echo "Ceramic installation completed successfully!" | |
| echo "You can now run 'ceramic' from Terminal" | |
| echo "To uninstall: uninstall-ceramic" | |
| echo "Log saved to /tmp/ceramic-install.log for debugging if needed" | |
| exit 0 | |
| EOF | |
| chmod +x scripts/postinstall | |
| - name: Create preinstall script | |
| run: | | |
| cat > scripts/preinstall << 'EOF' | |
| #!/bin/bash | |
| echo "Preparing for Ceramic installation..." | |
| # 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 | |
| echo "Removing existing Ceramic installation..." | |
| rm -rf "/usr/local/lib/ceramic" | |
| fi | |
| if [ -f "/usr/local/bin/ceramic" ]; then | |
| echo "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</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 Installer</title> | |
| <style> | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | |
| padding: 20px; | |
| } | |
| code { | |
| font-family: monospace; | |
| padding: 2px 6px; | |
| border: 1px solid; | |
| border-radius: 3px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Ceramic Installer</h2> | |
| <p>This will install Ceramic on this computer.</p> | |
| <p><strong>Requirement:</strong> <a href="https://haxe.org/download/">Haxe</a> must be installed first.</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; | |
| } | |
| code { | |
| font-family: monospace; | |
| padding: 2px 6px; | |
| border: 1px solid; | |
| border-radius: 3px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Installation Complete</h2> | |
| <p>Ceramic has been installed successfully.</p> | |
| <p>Run <code>ceramic</code> in Terminal to get started.</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: . | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -e | |
| 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 }} | |
| 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 }}"}' |