|
| 1 | +name: Build All Apps |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + # ============== AltarSender ============== |
| 14 | + build-altarsender-windows: |
| 15 | + runs-on: windows-latest |
| 16 | + defaults: |
| 17 | + run: |
| 18 | + working-directory: AltarSender |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: '3.11' |
| 24 | + - name: Install dependencies |
| 25 | + run: | |
| 26 | + python -m pip install --upgrade pip |
| 27 | + pip install -r requirements.txt |
| 28 | + pip install pyinstaller |
| 29 | + - name: Build |
| 30 | + shell: bash |
| 31 | + run: | |
| 32 | + CTK_PATH=$(python -c "import customtkinter; import os; print(os.path.dirname(customtkinter.__file__))") |
| 33 | + pyinstaller --noconfirm --onefile --windowed --name "AltarSender" --paths "." \ |
| 34 | + --add-data "${CTK_PATH};customtkinter" \ |
| 35 | + --hidden-import=services.experiment_sender --hidden-import=services.format_content \ |
| 36 | + --hidden-import=services.hash --hidden-import=services.mongo_conn \ |
| 37 | + --hidden-import=services.prefs --hidden-import=services.raw_data_saver \ |
| 38 | + --hidden-import=ui.app_view --hidden-import=ui.experiment_view \ |
| 39 | + --hidden-import=ui.mongo_view --hidden-import=ui.minio_view \ |
| 40 | + --hidden-import=customtkinter --hidden-import=sacred --hidden-import=sacred.observers \ |
| 41 | + --hidden-import=pymongo --hidden-import=pandas --hidden-import=numpy \ |
| 42 | + --hidden-import=openpyxl --hidden-import=boto3 --hidden-import=botocore \ |
| 43 | + --hidden-import=minio --hidden-import=PIL --hidden-import=PIL._tkinter_finder \ |
| 44 | + --hidden-import=yaml --collect-all=customtkinter --collect-all=sacred app.py |
| 45 | + - uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: AltarSender-Windows |
| 48 | + path: AltarSender/dist/AltarSender.exe |
| 49 | + |
| 50 | + build-altarsender-macos: |
| 51 | + runs-on: macos-latest |
| 52 | + defaults: |
| 53 | + run: |
| 54 | + working-directory: AltarSender |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + - uses: actions/setup-python@v5 |
| 58 | + with: |
| 59 | + python-version: '3.11' |
| 60 | + - run: brew install python-tk@3.11 || true |
| 61 | + - name: Install dependencies |
| 62 | + run: | |
| 63 | + python -m pip install --upgrade pip |
| 64 | + pip install -r requirements.txt |
| 65 | + pip install pyinstaller |
| 66 | + - name: Build |
| 67 | + run: | |
| 68 | + CTK_PATH=$(python -c "import customtkinter; import os; print(os.path.dirname(customtkinter.__file__))") |
| 69 | + pyinstaller --noconfirm --onefile --windowed --name "AltarSender" --paths "." \ |
| 70 | + --add-data "${CTK_PATH}:customtkinter" \ |
| 71 | + --hidden-import=services.experiment_sender --hidden-import=services.format_content \ |
| 72 | + --hidden-import=services.hash --hidden-import=services.mongo_conn \ |
| 73 | + --hidden-import=services.prefs --hidden-import=services.raw_data_saver \ |
| 74 | + --hidden-import=ui.app_view --hidden-import=ui.experiment_view \ |
| 75 | + --hidden-import=ui.mongo_view --hidden-import=ui.minio_view \ |
| 76 | + --hidden-import=customtkinter --hidden-import=sacred --hidden-import=sacred.observers \ |
| 77 | + --hidden-import=pymongo --hidden-import=pandas --hidden-import=numpy \ |
| 78 | + --hidden-import=openpyxl --hidden-import=boto3 --hidden-import=botocore \ |
| 79 | + --hidden-import=minio --hidden-import=PIL --hidden-import=PIL._tkinter_finder \ |
| 80 | + --hidden-import=yaml --collect-all=customtkinter --collect-all=sacred app.py |
| 81 | + - uses: actions/upload-artifact@v4 |
| 82 | + with: |
| 83 | + name: AltarSender-macOS |
| 84 | + path: AltarSender/dist/AltarSender |
| 85 | + |
| 86 | + build-altarsender-linux: |
| 87 | + runs-on: ubuntu-latest |
| 88 | + defaults: |
| 89 | + run: |
| 90 | + working-directory: AltarSender |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@v4 |
| 93 | + - uses: actions/setup-python@v5 |
| 94 | + with: |
| 95 | + python-version: '3.11' |
| 96 | + - run: sudo apt-get update && sudo apt-get install -y python3-tk |
| 97 | + - name: Install dependencies |
| 98 | + run: | |
| 99 | + python -m pip install --upgrade pip |
| 100 | + pip install -r requirements.txt |
| 101 | + pip install pyinstaller |
| 102 | + - name: Build |
| 103 | + run: | |
| 104 | + CTK_PATH=$(python -c "import customtkinter; import os; print(os.path.dirname(customtkinter.__file__))") |
| 105 | + pyinstaller --noconfirm --onefile --console --name "AltarSender" --paths "." \ |
| 106 | + --add-data "${CTK_PATH}:customtkinter" \ |
| 107 | + --hidden-import=services.experiment_sender --hidden-import=services.format_content \ |
| 108 | + --hidden-import=services.hash --hidden-import=services.mongo_conn \ |
| 109 | + --hidden-import=services.prefs --hidden-import=services.raw_data_saver \ |
| 110 | + --hidden-import=ui.app_view --hidden-import=ui.experiment_view \ |
| 111 | + --hidden-import=ui.mongo_view --hidden-import=ui.minio_view \ |
| 112 | + --hidden-import=customtkinter --hidden-import=sacred --hidden-import=sacred.observers \ |
| 113 | + --hidden-import=pymongo --hidden-import=pandas --hidden-import=numpy \ |
| 114 | + --hidden-import=openpyxl --hidden-import=boto3 --hidden-import=botocore \ |
| 115 | + --hidden-import=minio --hidden-import=PIL --hidden-import=PIL._tkinter_finder \ |
| 116 | + --hidden-import=yaml --collect-all=customtkinter --collect-all=sacred app.py |
| 117 | + chmod +x dist/AltarSender |
| 118 | + - uses: actions/upload-artifact@v4 |
| 119 | + with: |
| 120 | + name: AltarSender-Linux |
| 121 | + path: AltarSender/dist/AltarSender |
| 122 | + |
| 123 | + # ============== AltarExtractor ============== |
| 124 | + build-altarextractor-windows: |
| 125 | + runs-on: windows-latest |
| 126 | + defaults: |
| 127 | + run: |
| 128 | + working-directory: AltarExtractor |
| 129 | + steps: |
| 130 | + - uses: actions/checkout@v4 |
| 131 | + - uses: actions/setup-python@v5 |
| 132 | + with: |
| 133 | + python-version: '3.11' |
| 134 | + - name: Install dependencies |
| 135 | + run: | |
| 136 | + python -m pip install --upgrade pip |
| 137 | + pip install -r requirements.txt |
| 138 | + pip install pyinstaller |
| 139 | + - run: pyinstaller AltarExtractor.spec |
| 140 | + - uses: actions/upload-artifact@v4 |
| 141 | + with: |
| 142 | + name: AltarExtractor-Windows |
| 143 | + path: AltarExtractor/dist/AltarExtractor.exe |
| 144 | + |
| 145 | + build-altarextractor-macos: |
| 146 | + runs-on: macos-latest |
| 147 | + defaults: |
| 148 | + run: |
| 149 | + working-directory: AltarExtractor |
| 150 | + steps: |
| 151 | + - uses: actions/checkout@v4 |
| 152 | + - uses: actions/setup-python@v5 |
| 153 | + with: |
| 154 | + python-version: '3.11' |
| 155 | + - name: Install dependencies |
| 156 | + run: | |
| 157 | + python -m pip install --upgrade pip |
| 158 | + pip install -r requirements.txt |
| 159 | + pip install pyinstaller |
| 160 | + - run: pyinstaller AltarExtractor.spec |
| 161 | + - uses: actions/upload-artifact@v4 |
| 162 | + with: |
| 163 | + name: AltarExtractor-macOS |
| 164 | + path: AltarExtractor/dist/AltarExtractor |
| 165 | + |
| 166 | + build-altarextractor-linux: |
| 167 | + runs-on: ubuntu-latest |
| 168 | + defaults: |
| 169 | + run: |
| 170 | + working-directory: AltarExtractor |
| 171 | + steps: |
| 172 | + - uses: actions/checkout@v4 |
| 173 | + - uses: actions/setup-python@v5 |
| 174 | + with: |
| 175 | + python-version: '3.11' |
| 176 | + - run: sudo apt-get update && sudo apt-get install -y python3-tk |
| 177 | + - name: Install dependencies |
| 178 | + run: | |
| 179 | + python -m pip install --upgrade pip |
| 180 | + pip install -r requirements.txt |
| 181 | + pip install pyinstaller |
| 182 | + - run: pyinstaller AltarExtractor.spec |
| 183 | + - uses: actions/upload-artifact@v4 |
| 184 | + with: |
| 185 | + name: AltarExtractor-Linux |
| 186 | + path: AltarExtractor/dist/AltarExtractor |
| 187 | + |
| 188 | + # ============== AltarViewer ============== |
| 189 | + build-altarviewer-windows: |
| 190 | + runs-on: windows-latest |
| 191 | + defaults: |
| 192 | + run: |
| 193 | + working-directory: AltarViewer |
| 194 | + steps: |
| 195 | + - uses: actions/checkout@v4 |
| 196 | + - uses: actions/setup-python@v5 |
| 197 | + with: |
| 198 | + python-version: '3.11' |
| 199 | + - name: Install dependencies |
| 200 | + run: | |
| 201 | + python -m pip install --upgrade pip |
| 202 | + pip install -r requirements.txt |
| 203 | + pip install pyinstaller |
| 204 | + - run: pyinstaller AltarViewer.spec |
| 205 | + - uses: actions/upload-artifact@v4 |
| 206 | + with: |
| 207 | + name: AltarViewer-Windows |
| 208 | + path: AltarViewer/dist/AltarViewer.exe |
| 209 | + |
| 210 | + build-altarviewer-macos: |
| 211 | + runs-on: macos-latest |
| 212 | + defaults: |
| 213 | + run: |
| 214 | + working-directory: AltarViewer |
| 215 | + steps: |
| 216 | + - uses: actions/checkout@v4 |
| 217 | + - uses: actions/setup-python@v5 |
| 218 | + with: |
| 219 | + python-version: '3.11' |
| 220 | + - run: brew install python-tk@3.11 || true |
| 221 | + - name: Install dependencies |
| 222 | + run: | |
| 223 | + python -m pip install --upgrade pip |
| 224 | + pip install -r requirements.txt |
| 225 | + pip install pyinstaller |
| 226 | + - run: pyinstaller AltarViewer.spec |
| 227 | + - uses: actions/upload-artifact@v4 |
| 228 | + with: |
| 229 | + name: AltarViewer-macOS |
| 230 | + path: AltarViewer/dist/AltarViewer |
| 231 | + |
| 232 | + build-altarviewer-linux: |
| 233 | + runs-on: ubuntu-latest |
| 234 | + defaults: |
| 235 | + run: |
| 236 | + working-directory: AltarViewer |
| 237 | + steps: |
| 238 | + - uses: actions/checkout@v4 |
| 239 | + - uses: actions/setup-python@v5 |
| 240 | + with: |
| 241 | + python-version: '3.11' |
| 242 | + - run: sudo apt-get update && sudo apt-get install -y python3-tk |
| 243 | + - name: Install dependencies |
| 244 | + run: | |
| 245 | + python -m pip install --upgrade pip |
| 246 | + pip install -r requirements.txt |
| 247 | + pip install pyinstaller |
| 248 | + - run: pyinstaller AltarViewer.spec |
| 249 | + - uses: actions/upload-artifact@v4 |
| 250 | + with: |
| 251 | + name: AltarViewer-Linux |
| 252 | + path: AltarViewer/dist/AltarViewer |
| 253 | + |
| 254 | + # ============== Release ============== |
| 255 | + release: |
| 256 | + needs: |
| 257 | + - build-altarsender-windows |
| 258 | + - build-altarsender-macos |
| 259 | + - build-altarsender-linux |
| 260 | + - build-altarextractor-windows |
| 261 | + - build-altarextractor-macos |
| 262 | + - build-altarextractor-linux |
| 263 | + - build-altarviewer-windows |
| 264 | + - build-altarviewer-macos |
| 265 | + - build-altarviewer-linux |
| 266 | + runs-on: ubuntu-latest |
| 267 | + steps: |
| 268 | + - name: Download all artifacts |
| 269 | + uses: actions/download-artifact@v4 |
| 270 | + with: |
| 271 | + path: ./artifacts |
| 272 | + |
| 273 | + - name: Prepare release files |
| 274 | + run: | |
| 275 | + mkdir -p release |
| 276 | + # AltarSender |
| 277 | + cp ./artifacts/AltarSender-Windows/AltarSender.exe ./release/AltarSender-Windows.exe |
| 278 | + cp ./artifacts/AltarSender-macOS/AltarSender ./release/AltarSender-macOS |
| 279 | + cp ./artifacts/AltarSender-Linux/AltarSender ./release/AltarSender-Linux |
| 280 | + # AltarExtractor |
| 281 | + cp ./artifacts/AltarExtractor-Windows/AltarExtractor.exe ./release/AltarExtractor-Windows.exe |
| 282 | + cp ./artifacts/AltarExtractor-macOS/AltarExtractor ./release/AltarExtractor-macOS |
| 283 | + cp ./artifacts/AltarExtractor-Linux/AltarExtractor ./release/AltarExtractor-Linux |
| 284 | + # AltarViewer |
| 285 | + cp ./artifacts/AltarViewer-Windows/AltarViewer.exe ./release/AltarViewer-Windows.exe |
| 286 | + cp ./artifacts/AltarViewer-macOS/AltarViewer ./release/AltarViewer-macOS |
| 287 | + cp ./artifacts/AltarViewer-Linux/AltarViewer ./release/AltarViewer-Linux |
| 288 | + |
| 289 | + chmod +x ./release/*-macOS ./release/*-Linux |
| 290 | +
|
| 291 | + - name: Create Release |
| 292 | + uses: softprops/action-gh-release@v1 |
| 293 | + with: |
| 294 | + files: ./release/* |
| 295 | + draft: true |
| 296 | + prerelease: false |
| 297 | + body: | |
| 298 | + ## Altar Suite ${{ github.ref_name }} |
| 299 | + |
| 300 | + ### Downloads |
| 301 | + |
| 302 | + | App | Windows | macOS | Linux | |
| 303 | + |-----|---------|-------|-------| |
| 304 | + | **AltarSender** | [Download](AltarSender-Windows.exe) | [Download](AltarSender-macOS) | [Download](AltarSender-Linux) | |
| 305 | + | **AltarExtractor** | [Download](AltarExtractor-Windows.exe) | [Download](AltarExtractor-macOS) | [Download](AltarExtractor-Linux) | |
| 306 | + | **AltarViewer** | [Download](AltarViewer-Windows.exe) | [Download](AltarViewer-macOS) | [Download](AltarViewer-Linux) | |
| 307 | + env: |
| 308 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments