|
1 | | -name: Build Windows |
| 1 | +name: Build for Windows, Linux and macOS |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
8 | 8 | workflow_dispatch: |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - build: |
| 11 | + build-windows: |
12 | 12 | runs-on: windows-latest |
13 | 13 |
|
14 | 14 | steps: |
@@ -43,3 +43,115 @@ jobs: |
43 | 43 | with: |
44 | 44 | name: psio-assist-windows |
45 | 45 | path: build/Release/*.exe |
| 46 | + |
| 47 | + build-linux: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + sudo apt-get update |
| 56 | + sudo apt-get install -y build-essential cmake libgl1-mesa-dev |
| 57 | + |
| 58 | + - name: Install Qt |
| 59 | + uses: jurplel/install-qt-action@v3 |
| 60 | + with: |
| 61 | + version: '6.5.3' |
| 62 | + host: 'linux' |
| 63 | + target: 'desktop' |
| 64 | + arch: 'gcc_64' |
| 65 | + cache: true |
| 66 | + |
| 67 | + - name: Create Build Directory |
| 68 | + run: mkdir -p build |
| 69 | + |
| 70 | + - name: Configure and Build |
| 71 | + run: | |
| 72 | + cd build |
| 73 | + cmake .. |
| 74 | + cmake --build . -j$(nproc) |
| 75 | + |
| 76 | + - name: Upload Artifact |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + with: |
| 79 | + name: psio-assist-linux |
| 80 | + path: build/psio-assist |
| 81 | + |
| 82 | + build-macos: |
| 83 | + runs-on: macos-latest |
| 84 | + |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + |
| 88 | + - name: Install Qt |
| 89 | + uses: jurplel/install-qt-action@v3 |
| 90 | + with: |
| 91 | + version: '6.5.3' |
| 92 | + host: 'mac' |
| 93 | + target: 'desktop' |
| 94 | + arch: 'clang_64' |
| 95 | + cache: true |
| 96 | + |
| 97 | + - name: Create Build Directory |
| 98 | + run: mkdir -p build |
| 99 | + |
| 100 | + - name: Configure and Build |
| 101 | + run: | |
| 102 | + cd build |
| 103 | + cmake .. |
| 104 | + cmake --build . -j$(sysctl -n hw.ncpu) |
| 105 | + |
| 106 | + - name: Create App Bundle |
| 107 | + working-directory: ./build |
| 108 | + run: | |
| 109 | + # Criar diretório para o app bundle se não existir |
| 110 | + mkdir -p psio-assist.app/Contents/MacOS |
| 111 | + mkdir -p psio-assist.app/Contents/Resources |
| 112 | + |
| 113 | + # Copiar o executável |
| 114 | + cp psio-assist psio-assist.app/Contents/MacOS/ |
| 115 | + |
| 116 | + # Criar arquivo Info.plist básico |
| 117 | + cat > psio-assist.app/Contents/Info.plist << EOF |
| 118 | + <?xml version="1.0" encoding="UTF-8"?> |
| 119 | + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 120 | + <plist version="1.0"> |
| 121 | + <dict> |
| 122 | + <key>CFBundleExecutable</key> |
| 123 | + <string>psio-assist</string> |
| 124 | + <key>CFBundleIconFile</key> |
| 125 | + <string>icon.icns</string> |
| 126 | + <key>CFBundleIdentifier</key> |
| 127 | + <string>com.yourcompany.psio-assist</string> |
| 128 | + <key>CFBundleInfoDictionaryVersion</key> |
| 129 | + <string>6.0</string> |
| 130 | + <key>CFBundleName</key> |
| 131 | + <string>PSIO Assist</string> |
| 132 | + <key>CFBundlePackageType</key> |
| 133 | + <string>APPL</string> |
| 134 | + <key>CFBundleShortVersionString</key> |
| 135 | + <string>1.0</string> |
| 136 | + <key>CFBundleVersion</key> |
| 137 | + <string>1</string> |
| 138 | + <key>NSHighResolutionCapable</key> |
| 139 | + <true/> |
| 140 | + </dict> |
| 141 | + </plist> |
| 142 | + EOF |
| 143 | + |
| 144 | + # Criar um arquivo DMG |
| 145 | + hdiutil create -volname "PSIO Assist" -srcfolder psio-assist.app -ov -format UDZO psio-assist.dmg |
| 146 | + |
| 147 | + - name: Upload App Bundle |
| 148 | + uses: actions/upload-artifact@v4 |
| 149 | + with: |
| 150 | + name: psio-assist-macos-app |
| 151 | + path: build/psio-assist.app |
| 152 | + |
| 153 | + - name: Upload DMG |
| 154 | + uses: actions/upload-artifact@v4 |
| 155 | + with: |
| 156 | + name: psio-assist-macos-dmg |
| 157 | + path: build/psio-assist.dmg |
0 commit comments