Merge pull request #26 from Cloud2BR/bug2x #41
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 Legacy CLI Artifacts (No Release Publish) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install icon tooling | |
| run: python -m pip install --upgrade pillow | |
| - name: Ensure icon asset exists | |
| shell: bash | |
| run: | | |
| if [ ! -f assets/devopster-icon.png ]; then | |
| echo "assets/devopster-icon.png is required for release packaging" | |
| exit 1 | |
| fi | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build release binary | |
| run: cargo build --release --locked | |
| - name: Package Linux artifact | |
| if: runner.os == 'Linux' | |
| run: | | |
| mkdir -p dist/linux-package | |
| cp target/release/devopster dist/linux-package/ | |
| cp assets/devopster-icon.png dist/linux-package/ | |
| cat > dist/linux-package/devopster-cli.desktop <<'EOF' | |
| [Desktop Entry] | |
| Type=Application | |
| Name=DevOpster CLI | |
| Comment=Delivery-first DevOps CLI control plane | |
| Exec=devopster | |
| Icon=devopster-icon | |
| Terminal=true | |
| Categories=Development;Utility; | |
| EOF | |
| cat > dist/linux-package/devopster-gui.desktop <<'EOF' | |
| [Desktop Entry] | |
| Type=Application | |
| Name=DevOpster GUI Launcher | |
| Comment=Launch interactive DevOpster mode | |
| Exec=devopster gui | |
| Icon=devopster-icon | |
| Terminal=true | |
| Categories=Development;Utility; | |
| EOF | |
| cat > dist/linux-package/devopster.metainfo.xml <<'EOF' | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <component type="console-application"> | |
| <id>io.cloud2br.devopster</id> | |
| <name>DevOpster</name> | |
| <summary>Delivery-first DevOps CLI control plane</summary> | |
| <metadata_license>CC0-1.0</metadata_license> | |
| <project_license>AGPL-3.0-or-later</project_license> | |
| <description> | |
| <p>Cross-platform CLI for repository governance across GitHub, Azure DevOps, and GitLab.</p> | |
| </description> | |
| </component> | |
| EOF | |
| cat > dist/linux-package/devopster-gui.sh <<'EOF' | |
| #!/usr/bin/env sh | |
| DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) | |
| exec "$DIR/devopster" gui "$@" | |
| EOF | |
| chmod +x dist/linux-package/devopster-gui.sh | |
| tar -czf dist/devopster-linux-x86_64.tar.gz -C dist/linux-package devopster devopster-icon.png devopster-cli.desktop devopster-gui.desktop devopster.metainfo.xml devopster-gui.sh | |
| - name: Package Windows artifact | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| New-Item -ItemType Directory -Force -Path dist/windows-package | Out-Null | |
| Copy-Item target/release/devopster.exe dist/windows-package/devopster.exe | |
| Copy-Item assets/devopster-icon.png dist/windows-package/devopster-icon.png | |
| python -c "from PIL import Image; img = Image.open('assets/devopster-icon.png').convert('RGBA'); img.save('dist/windows-package/devopster.ico', format='ICO', sizes=[(16,16),(24,24),(32,32),(48,48),(64,64),(128,128),(256,256)])" | |
| @' | |
| @echo off | |
| cd /d "%~dp0" | |
| devopster.exe gui | |
| '@ | Set-Content -Path dist/windows-package/DevOpster-GUI.cmd -NoNewline | |
| Compress-Archive -Path dist/windows-package/* -DestinationPath dist/devopster-windows-x86_64.zip -Force | |
| - name: Package macOS artifacts | |
| if: runner.os == 'macOS' | |
| run: | | |
| mkdir -p dist/devopster-cli | |
| # iconutil requires the directory to end with .iconset | |
| mkdir -p dist/devopster.iconset | |
| cp target/release/devopster dist/devopster-cli/ | |
| cp assets/devopster-icon.png dist/devopster-cli/ | |
| sips -z 16 16 assets/devopster-icon.png --out dist/devopster.iconset/icon_16x16.png | |
| sips -z 32 32 assets/devopster-icon.png --out dist/devopster.iconset/[email protected] | |
| sips -z 32 32 assets/devopster-icon.png --out dist/devopster.iconset/icon_32x32.png | |
| sips -z 64 64 assets/devopster-icon.png --out dist/devopster.iconset/[email protected] | |
| sips -z 128 128 assets/devopster-icon.png --out dist/devopster.iconset/icon_128x128.png | |
| sips -z 256 256 assets/devopster-icon.png --out dist/devopster.iconset/[email protected] | |
| sips -z 256 256 assets/devopster-icon.png --out dist/devopster.iconset/icon_256x256.png | |
| sips -z 512 512 assets/devopster-icon.png --out dist/devopster.iconset/[email protected] | |
| sips -z 512 512 assets/devopster-icon.png --out dist/devopster.iconset/icon_512x512.png | |
| # icon_512x512@2x must be 1024x1024 — upscale from source | |
| sips -z 1024 1024 assets/devopster-icon.png --out dist/devopster.iconset/[email protected] | |
| iconutil -c icns dist/devopster.iconset -o dist/devopster.icns | |
| cp dist/devopster.icns dist/devopster-cli/ | |
| mkdir -p "dist/devopster-cli/DevOpster GUI.app/Contents/MacOS" | |
| mkdir -p "dist/devopster-cli/DevOpster GUI.app/Contents/Resources/bin" | |
| cp target/release/devopster "dist/devopster-cli/DevOpster GUI.app/Contents/Resources/bin/devopster" | |
| cp dist/devopster.icns "dist/devopster-cli/DevOpster GUI.app/Contents/Resources/devopster.icns" | |
| cat > "dist/devopster-cli/DevOpster GUI.app/Contents/Info.plist" <<'EOF' | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleDevelopmentRegion</key> | |
| <string>en</string> | |
| <key>CFBundleExecutable</key> | |
| <string>devopster-gui-launcher</string> | |
| <key>CFBundleIconFile</key> | |
| <string>devopster.icns</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>io.cloud2br.devopster.gui</string> | |
| <key>CFBundleInfoDictionaryVersion</key> | |
| <string>6.0</string> | |
| <key>CFBundleName</key> | |
| <string>DevOpster GUI</string> | |
| <key>CFBundlePackageType</key> | |
| <string>APPL</string> | |
| <key>CFBundleShortVersionString</key> | |
| <string>0.1.0</string> | |
| <key>CFBundleVersion</key> | |
| <string>1</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| cat > "dist/devopster-cli/DevOpster GUI.app/Contents/MacOS/devopster-gui-launcher" <<'EOF' | |
| #!/usr/bin/env sh | |
| APP_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) | |
| BIN="$APP_ROOT/Resources/bin/devopster" | |
| osascript <<OSA | |
| tell application "Terminal" | |
| activate | |
| do script quoted form of "$BIN" & " gui" | |
| end tell | |
| OSA | |
| EOF | |
| chmod +x "dist/devopster-cli/DevOpster GUI.app/Contents/MacOS/devopster-gui-launcher" | |
| tar -czf dist/devopster-macos-x86_64.tar.gz -C dist/devopster-cli devopster devopster-icon.png devopster.icns | |
| hdiutil create -volname devopster-cli -srcfolder dist/devopster-cli -ov -format UDZO dist/devopster-macos.dmg | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: devopster-${{ runner.os }} | |
| path: dist/* | |