|
1 | | -name: Build ProStore iOS (Unsigned) |
| 1 | +name: ProStore iOS Build and Release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
|
17 | 17 | build-unsigned-ipa: |
18 | 18 | runs-on: macos-15 |
19 | 19 | timeout-minutes: 60 |
20 | | - |
| 20 | + outputs: |
| 21 | + version: ${{ steps.get_version.outputs.version }} |
| 22 | + release_exists: ${{ steps.check_release.outputs.exists }} |
| 23 | + changelog: ${{ steps.generate_changelog.outputs.CHANGELOG }} |
21 | 24 | steps: |
22 | 25 | - name: Checkout repo (full history) |
23 | 26 | uses: actions/checkout@v4 |
@@ -362,38 +365,102 @@ jobs: |
362 | 365 | echo "EOF" >> $GITHUB_OUTPUT |
363 | 366 | shell: bash |
364 | 367 |
|
| 368 | + create-github-release: |
| 369 | + needs: build-unsigned-ipa |
| 370 | + if: needs.build-unsigned-ipa.outputs.release_exists == 'false' |
| 371 | + runs-on: ubuntu-latest |
| 372 | + steps: |
| 373 | + - name: Ensure gh exists (best-effort) |
| 374 | + run: | |
| 375 | + # gh (GitHub CLI) |
| 376 | + if ! command -v gh >/dev/null 2>&1; then |
| 377 | + echo "gh not found — attempting official installer script" |
| 378 | + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg |
| 379 | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null |
| 380 | + sudo apt update |
| 381 | + sudo apt install gh -y || true |
| 382 | + fi |
| 383 | +
|
| 384 | + echo "gh: $(gh --version 2>/dev/null || echo 'not installed')" |
| 385 | +
|
| 386 | + - name: Download device IPA artifact |
| 387 | + uses: actions/download-artifact@v4 |
| 388 | + with: |
| 389 | + name: com.prostoreios.prostore-unsigned-ios.ipa |
| 390 | + path: build |
| 391 | + |
| 392 | + - name: Download simulator IPA artifact (optional) |
| 393 | + uses: actions/download-artifact@v4 |
| 394 | + continue-on-error: true |
| 395 | + with: |
| 396 | + name: com.prostoreios.prostore-unsigned-iossimulator.ipa |
| 397 | + path: build |
| 398 | + |
365 | 399 | - name: Create GitHub Release |
366 | | - if: steps.check_release.outputs.exists == 'false' |
367 | 400 | env: |
368 | 401 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 402 | + VERSION: ${{ needs.build-unsigned-ipa.outputs.version }} |
| 403 | + CHANGELOG: ${{ needs.build-unsigned-ipa.outputs.changelog }} |
369 | 404 | run: | |
370 | | - VERSION="${{ steps.get_version.outputs.version }}" |
371 | 405 | TAG="v$VERSION" |
372 | | - CHANGELOG="${{ steps.generate_changelog.outputs.CHANGELOG }}" |
373 | 406 | echo "Creating release $TAG with notes:" |
374 | 407 | printf '%s\n' "$CHANGELOG" |
| 408 | + DEVICE_IPA="build/com.prostoreios.prostore-unsigned-ios.ipa" |
| 409 | + SIM_IPA="build/com.prostoreios.prostore-unsigned-iossimulator.ipa" |
| 410 | + SIM_ARG="" |
| 411 | + if [ -f "$SIM_IPA" ]; then |
| 412 | + SIM_ARG="$SIM_IPA" |
| 413 | + fi |
375 | 414 | gh release create "$TAG" \ |
376 | | - build/com.prostoreios.prostore-unsigned-ios.ipa \ |
377 | | - build/com.prostoreios.prostore-unsigned-iossimulator.ipa \ |
| 415 | + "$DEVICE_IPA" $SIM_ARG \ |
378 | 416 | --title "ProStore v$VERSION" \ |
379 | 417 | --notes "$CHANGELOG" |
380 | 418 | shell: bash |
381 | 419 |
|
| 420 | + create-app-source-json: |
| 421 | + needs: build-unsigned-ipa |
| 422 | + if: needs.build-unsigned-ipa.outputs.release_exists == 'false' |
| 423 | + runs-on: ubuntu-latest |
| 424 | + permissions: |
| 425 | + contents: write |
| 426 | + steps: |
| 427 | + - name: Checkout repo (full history) |
| 428 | + uses: actions/checkout@v4 |
| 429 | + with: |
| 430 | + fetch-depth: 0 |
| 431 | + persist-credentials: true |
| 432 | + |
| 433 | + - name: Ensure jq exists (best-effort) |
| 434 | + run: | |
| 435 | + # jq |
| 436 | + if ! command -v jq >/dev/null 2>&1; then |
| 437 | + echo "jq not found — attempting to install" |
| 438 | + sudo apt update |
| 439 | + sudo apt install jq -y || true |
| 440 | + fi |
| 441 | +
|
| 442 | + echo "jq: $(jq --version 2>/dev/null || echo 'not installed')" |
| 443 | +
|
| 444 | + - name: Download device IPA artifact |
| 445 | + uses: actions/download-artifact@v4 |
| 446 | + with: |
| 447 | + name: com.prostoreios.prostore-unsigned-ios.ipa |
| 448 | + path: build |
| 449 | + |
382 | 450 | - name: Update app-repo.json with latest ProStore version |
383 | | - if: steps.check_release.outputs.exists == 'false' |
384 | 451 | env: |
385 | 452 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 453 | + VERSION: ${{ needs.build-unsigned-ipa.outputs.version }} |
| 454 | + CHANGELOG: ${{ needs.build-unsigned-ipa.outputs.changelog }} |
386 | 455 | run: | |
387 | 456 | set -e |
388 | | - VERSION="${{ steps.get_version.outputs.version }}" |
389 | 457 | IPA_PATH="$PWD/build/com.prostoreios.prostore-unsigned-ios.ipa" |
390 | 458 | DOWNLOAD_URL="https://github.com/ProStore-iOS/ProStore/releases/download/v$VERSION/com.prostoreios.prostore-unsigned-ios.ipa" |
391 | 459 | REPO_FILE="app-repo.json" |
392 | | - CHANGELOG="${{ steps.generate_changelog.outputs.CHANGELOG }}" |
393 | 460 |
|
394 | 461 | if [ -f "$IPA_PATH" ]; then |
395 | | - IPA_SIZE=$(stat -f%z "$IPA_PATH") |
396 | | - SHA256=$(shasum -a 256 "$IPA_PATH" | awk '{print $1}') |
| 462 | + IPA_SIZE=$(stat -c%s "$IPA_PATH") |
| 463 | + SHA256=$(sha256sum "$IPA_PATH" | awk '{print $1}') |
397 | 464 | else |
398 | 465 | IPA_SIZE=0 |
399 | 466 | SHA256="" |
@@ -502,12 +569,11 @@ jobs: |
502 | 569 | shell: bash |
503 | 570 |
|
504 | 571 | - name: Push apps.json to Pages repo (ProStore-iOS.github.io) using PAT |
505 | | - if: steps.check_release.outputs.exists == 'false' |
506 | 572 | env: |
507 | 573 | PAGES_PAT: ${{ secrets.PAGES_PAT }} |
508 | 574 | run: | |
509 | 575 | set -e |
510 | | - VERSION="${{ steps.get_version.outputs.version }}" |
| 576 | + VERSION="${{ needs.build-unsigned-ipa.outputs.version }}" |
511 | 577 | PAGES_REPO="ProStore-iOS/ProStore-iOS.github.io" |
512 | 578 | PAGES_DIR=$(mktemp -d) |
513 | 579 |
|
|
0 commit comments