|
| 1 | +name: Rebuild COPR Packages |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + start_from: |
| 7 | + description: 'Start rebuilding from batch (rebuilds selected batch and all later batches)' |
| 8 | + required: true |
| 9 | + default: 'batch-1' |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - batch-1 |
| 13 | + - batch-2 |
| 14 | + - batch-3 |
| 15 | + - batch-4 |
| 16 | + - batch-5 |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 20 | + cancel-in-progress: false # Don't cancel COPR builds in progress |
| 21 | + |
| 22 | +env: |
| 23 | + COPR_PROJECT: binarypie/hypercube |
| 24 | + |
| 25 | +jobs: |
| 26 | + batch-1: |
| 27 | + if: inputs.start_from == 'batch-1' |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - name: Install copr-cli |
| 31 | + run: | |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install -y python3-pip |
| 34 | + pip3 install copr-cli |
| 35 | +
|
| 36 | + - name: Configure COPR |
| 37 | + run: | |
| 38 | + mkdir -p ~/.config |
| 39 | + echo "${{ secrets.COPR_CONFIG }}" > ~/.config/copr |
| 40 | +
|
| 41 | + - name: Build Batch 1 packages |
| 42 | + run: | |
| 43 | + # Batch 1: No dependencies - can build in parallel |
| 44 | + PACKAGES=( |
| 45 | + hyprutils |
| 46 | + hyprwayland-scanner |
| 47 | + hyprland-protocols |
| 48 | + glaze |
| 49 | + uwsm |
| 50 | + eza |
| 51 | + starship |
| 52 | + lazygit |
| 53 | + ghostty |
| 54 | + quickshell |
| 55 | + livesys-scripts |
| 56 | + wifitui |
| 57 | + ) |
| 58 | +
|
| 59 | + echo "Starting Batch 1 builds..." |
| 60 | + for pkg in "${PACKAGES[@]}"; do |
| 61 | + echo "Triggering build for $pkg..." |
| 62 | + copr-cli build-package --name "$pkg" "$COPR_PROJECT" || echo "Warning: $pkg build trigger failed" |
| 63 | + done |
| 64 | +
|
| 65 | + - name: Wait for Batch 1 completion |
| 66 | + run: | |
| 67 | + echo "Waiting for Batch 1 builds to complete..." |
| 68 | + echo "Check status at: https://copr.fedorainfracloud.org/coprs/$COPR_PROJECT/builds/" |
| 69 | + sleep 300 # 5 minutes initial wait |
| 70 | +
|
| 71 | + for i in {1..60}; do |
| 72 | + RUNNING=$(copr-cli list-builds "$COPR_PROJECT" --output-format text | grep -c "running\|pending\|starting" || true) |
| 73 | + if [ "$RUNNING" -eq 0 ]; then |
| 74 | + echo "All Batch 1 builds completed!" |
| 75 | + break |
| 76 | + fi |
| 77 | + echo "Waiting for $RUNNING builds to complete... (attempt $i/60)" |
| 78 | + sleep 60 |
| 79 | + done |
| 80 | +
|
| 81 | + batch-2: |
| 82 | + if: always() && (inputs.start_from == 'batch-1' || inputs.start_from == 'batch-2') |
| 83 | + needs: batch-1 |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Check previous batch |
| 87 | + if: inputs.start_from == 'batch-1' && needs.batch-1.result != 'success' |
| 88 | + run: | |
| 89 | + echo "Batch 1 failed, stopping pipeline" |
| 90 | + exit 1 |
| 91 | +
|
| 92 | + - name: Install copr-cli |
| 93 | + run: | |
| 94 | + sudo apt-get update |
| 95 | + sudo apt-get install -y python3-pip |
| 96 | + pip3 install copr-cli |
| 97 | +
|
| 98 | + - name: Configure COPR |
| 99 | + run: | |
| 100 | + mkdir -p ~/.config |
| 101 | + echo "${{ secrets.COPR_CONFIG }}" > ~/.config/copr |
| 102 | +
|
| 103 | + - name: Build Batch 2 packages |
| 104 | + run: | |
| 105 | + # Batch 2: Depends on Batch 1 |
| 106 | + PACKAGES=( |
| 107 | + hyprlang |
| 108 | + hyprgraphics |
| 109 | + aquamarine |
| 110 | + ) |
| 111 | +
|
| 112 | + echo "Starting Batch 2 builds..." |
| 113 | + for pkg in "${PACKAGES[@]}"; do |
| 114 | + echo "Triggering build for $pkg..." |
| 115 | + copr-cli build-package --name "$pkg" "$COPR_PROJECT" || echo "Warning: $pkg build trigger failed" |
| 116 | + done |
| 117 | +
|
| 118 | + - name: Wait for Batch 2 completion |
| 119 | + run: | |
| 120 | + echo "Waiting for Batch 2 builds to complete..." |
| 121 | + sleep 300 |
| 122 | +
|
| 123 | + for i in {1..60}; do |
| 124 | + RUNNING=$(copr-cli list-builds "$COPR_PROJECT" --output-format text | grep -c "running\|pending\|starting" || true) |
| 125 | + if [ "$RUNNING" -eq 0 ]; then |
| 126 | + echo "All Batch 2 builds completed!" |
| 127 | + break |
| 128 | + fi |
| 129 | + echo "Waiting for $RUNNING builds to complete... (attempt $i/60)" |
| 130 | + sleep 60 |
| 131 | + done |
| 132 | +
|
| 133 | + batch-3: |
| 134 | + if: always() && (inputs.start_from == 'batch-1' || inputs.start_from == 'batch-2' || inputs.start_from == 'batch-3') |
| 135 | + needs: batch-2 |
| 136 | + runs-on: ubuntu-latest |
| 137 | + steps: |
| 138 | + - name: Check previous batch |
| 139 | + if: (inputs.start_from == 'batch-1' || inputs.start_from == 'batch-2') && needs.batch-2.result != 'success' |
| 140 | + run: | |
| 141 | + echo "Previous batch failed, stopping pipeline" |
| 142 | + exit 1 |
| 143 | +
|
| 144 | + - name: Install copr-cli |
| 145 | + run: | |
| 146 | + sudo apt-get update |
| 147 | + sudo apt-get install -y python3-pip |
| 148 | + pip3 install copr-cli |
| 149 | +
|
| 150 | + - name: Configure COPR |
| 151 | + run: | |
| 152 | + mkdir -p ~/.config |
| 153 | + echo "${{ secrets.COPR_CONFIG }}" > ~/.config/copr |
| 154 | +
|
| 155 | + - name: Build Batch 3 packages |
| 156 | + run: | |
| 157 | + # Batch 3: Depends on Batch 2 |
| 158 | + PACKAGES=( |
| 159 | + hyprcursor |
| 160 | + hyprland-qt-support |
| 161 | + ) |
| 162 | +
|
| 163 | + echo "Starting Batch 3 builds..." |
| 164 | + for pkg in "${PACKAGES[@]}"; do |
| 165 | + echo "Triggering build for $pkg..." |
| 166 | + copr-cli build-package --name "$pkg" "$COPR_PROJECT" || echo "Warning: $pkg build trigger failed" |
| 167 | + done |
| 168 | +
|
| 169 | + - name: Wait for Batch 3 completion |
| 170 | + run: | |
| 171 | + echo "Waiting for Batch 3 builds to complete..." |
| 172 | + sleep 300 |
| 173 | +
|
| 174 | + for i in {1..60}; do |
| 175 | + RUNNING=$(copr-cli list-builds "$COPR_PROJECT" --output-format text | grep -c "running\|pending\|starting" || true) |
| 176 | + if [ "$RUNNING" -eq 0 ]; then |
| 177 | + echo "All Batch 3 builds completed!" |
| 178 | + break |
| 179 | + fi |
| 180 | + echo "Waiting for $RUNNING builds to complete... (attempt $i/60)" |
| 181 | + sleep 60 |
| 182 | + done |
| 183 | +
|
| 184 | + batch-4: |
| 185 | + if: always() && (inputs.start_from == 'batch-1' || inputs.start_from == 'batch-2' || inputs.start_from == 'batch-3' || inputs.start_from == 'batch-4') |
| 186 | + needs: batch-3 |
| 187 | + runs-on: ubuntu-latest |
| 188 | + steps: |
| 189 | + - name: Check previous batch |
| 190 | + if: inputs.start_from != 'batch-4' && needs.batch-3.result != 'success' |
| 191 | + run: | |
| 192 | + echo "Previous batch failed, stopping pipeline" |
| 193 | + exit 1 |
| 194 | +
|
| 195 | + - name: Install copr-cli |
| 196 | + run: | |
| 197 | + sudo apt-get update |
| 198 | + sudo apt-get install -y python3-pip |
| 199 | + pip3 install copr-cli |
| 200 | +
|
| 201 | + - name: Configure COPR |
| 202 | + run: | |
| 203 | + mkdir -p ~/.config |
| 204 | + echo "${{ secrets.COPR_CONFIG }}" > ~/.config/copr |
| 205 | +
|
| 206 | + - name: Build Batch 4 packages |
| 207 | + run: | |
| 208 | + # Batch 4: Depends on Batch 3 |
| 209 | + PACKAGES=( |
| 210 | + hyprland |
| 211 | + hyprlock |
| 212 | + hypridle |
| 213 | + hyprpaper |
| 214 | + xdg-desktop-portal-hyprland |
| 215 | + hyprpolkitagent |
| 216 | + hyprtoolkit |
| 217 | + ) |
| 218 | +
|
| 219 | + echo "Starting Batch 4 builds..." |
| 220 | + for pkg in "${PACKAGES[@]}"; do |
| 221 | + echo "Triggering build for $pkg..." |
| 222 | + copr-cli build-package --name "$pkg" "$COPR_PROJECT" || echo "Warning: $pkg build trigger failed" |
| 223 | + done |
| 224 | +
|
| 225 | + - name: Wait for Batch 4 completion |
| 226 | + run: | |
| 227 | + echo "Waiting for Batch 4 builds to complete..." |
| 228 | + sleep 600 # Longer wait for hyprland (big package) |
| 229 | +
|
| 230 | + for i in {1..90}; do |
| 231 | + RUNNING=$(copr-cli list-builds "$COPR_PROJECT" --output-format text | grep -c "running\|pending\|starting" || true) |
| 232 | + if [ "$RUNNING" -eq 0 ]; then |
| 233 | + echo "All Batch 4 builds completed!" |
| 234 | + break |
| 235 | + fi |
| 236 | + echo "Waiting for $RUNNING builds to complete... (attempt $i/90)" |
| 237 | + sleep 60 |
| 238 | + done |
| 239 | +
|
| 240 | + batch-5: |
| 241 | + if: always() |
| 242 | + needs: batch-4 |
| 243 | + runs-on: ubuntu-latest |
| 244 | + steps: |
| 245 | + - name: Check previous batch |
| 246 | + if: inputs.start_from != 'batch-5' && needs.batch-4.result != 'success' |
| 247 | + run: | |
| 248 | + echo "Previous batch failed, stopping pipeline" |
| 249 | + exit 1 |
| 250 | +
|
| 251 | + - name: Install copr-cli |
| 252 | + run: | |
| 253 | + sudo apt-get update |
| 254 | + sudo apt-get install -y python3-pip |
| 255 | + pip3 install copr-cli |
| 256 | +
|
| 257 | + - name: Configure COPR |
| 258 | + run: | |
| 259 | + mkdir -p ~/.config |
| 260 | + echo "${{ secrets.COPR_CONFIG }}" > ~/.config/copr |
| 261 | +
|
| 262 | + - name: Build Batch 5 packages |
| 263 | + run: | |
| 264 | + # Batch 5: Depends on Batch 4 |
| 265 | + PACKAGES=( |
| 266 | + hyprland-guiutils |
| 267 | + ) |
| 268 | +
|
| 269 | + echo "Starting Batch 5 builds..." |
| 270 | + for pkg in "${PACKAGES[@]}"; do |
| 271 | + echo "Triggering build for $pkg..." |
| 272 | + copr-cli build-package --name "$pkg" "$COPR_PROJECT" || echo "Warning: $pkg build trigger failed" |
| 273 | + done |
| 274 | +
|
| 275 | + - name: Wait for Batch 5 completion |
| 276 | + run: | |
| 277 | + echo "Waiting for Batch 5 builds to complete..." |
| 278 | + sleep 300 |
| 279 | +
|
| 280 | + for i in {1..60}; do |
| 281 | + RUNNING=$(copr-cli list-builds "$COPR_PROJECT" --output-format text | grep -c "running\|pending\|starting" || true) |
| 282 | + if [ "$RUNNING" -eq 0 ]; then |
| 283 | + echo "All Batch 5 builds completed!" |
| 284 | + break |
| 285 | + fi |
| 286 | + echo "Waiting for $RUNNING builds to complete... (attempt $i/60)" |
| 287 | + sleep 60 |
| 288 | + done |
| 289 | +
|
| 290 | + - name: Summary |
| 291 | + run: | |
| 292 | + echo "COPR rebuild complete!" |
| 293 | + echo "View results at: https://copr.fedorainfracloud.org/coprs/$COPR_PROJECT/builds/" |
0 commit comments