|
| 1 | +name: ios |
| 2 | + |
| 3 | +# Builds an UNSIGNED .ipa for sideloading. |
| 4 | +# |
| 5 | +# Unsigned on purpose. `tauri ios build` has no no-sign option and wants a |
| 6 | +# signing identity and a team, which would mean an Apple account and |
| 7 | +# certificates in secrets. Sideload tools (AltStore, SideStore, Sideloadly) |
| 8 | +# re-sign the payload themselves, so a signed artifact from CI would only be |
| 9 | +# thrown away. That is why this drops to xcodebuild instead of the Tauri CLI for |
| 10 | +# the archive step. |
| 11 | +# |
| 12 | +# Manual for now: nothing here has ever run, and the generated Xcode project's |
| 13 | +# names are discovered rather than assumed. Once a run succeeds, fold it into |
| 14 | +# build.yml so it ships with the other installers. |
| 15 | +on: |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +jobs: |
| 19 | + ipa: |
| 20 | + runs-on: macos-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - uses: dtolnay/rust-toolchain@stable |
| 25 | + with: |
| 26 | + targets: aarch64-apple-ios |
| 27 | + |
| 28 | + - uses: Swatinem/rust-cache@v2 |
| 29 | + |
| 30 | + - name: tauri cli |
| 31 | + run: cargo install tauri-cli --version "^2" --locked |
| 32 | + |
| 33 | + - name: icons |
| 34 | + run: cargo tauri icon icon-source.png --ios-color '#c8901f' |
| 35 | + |
| 36 | + # Generates gen/apple/. --ci keeps it from prompting. |
| 37 | + - name: scaffold xcode project |
| 38 | + run: cargo tauri ios init --ci |
| 39 | + |
| 40 | + # The scheme and project names depend on how Tauri derives them from the |
| 41 | + # crate, so read them rather than guess. This step is also the log to look |
| 42 | + # at when something below cannot find a path. |
| 43 | + - name: discover project |
| 44 | + id: xc |
| 45 | + run: | |
| 46 | + set -eux |
| 47 | + ls -la gen/apple |
| 48 | + proj=$(find gen/apple -maxdepth 1 -name '*.xcodeproj' | head -1) |
| 49 | + echo "proj=$proj" >> "$GITHUB_OUTPUT" |
| 50 | + xcodebuild -project "$proj" -list |
| 51 | + scheme=$(xcodebuild -project "$proj" -list -json \ |
| 52 | + | python3 -c 'import json,sys; s=json.load(sys.stdin)["project"]["schemes"]; print(next((x for x in s if "iOS" in x), s[0]))') |
| 53 | + echo "scheme=$scheme" >> "$GITHUB_OUTPUT" |
| 54 | +
|
| 55 | + - name: archive (unsigned) |
| 56 | + run: | |
| 57 | + set -eux |
| 58 | + xcodebuild archive \ |
| 59 | + -project "${{ steps.xc.outputs.proj }}" \ |
| 60 | + -scheme "${{ steps.xc.outputs.scheme }}" \ |
| 61 | + -configuration release \ |
| 62 | + -sdk iphoneos \ |
| 63 | + -archivePath "$PWD/build/pixity.xcarchive" \ |
| 64 | + -destination 'generic/platform=iOS' \ |
| 65 | + CODE_SIGNING_ALLOWED=NO \ |
| 66 | + CODE_SIGNING_REQUIRED=NO \ |
| 67 | + CODE_SIGN_IDENTITY="" \ |
| 68 | + CODE_SIGN_ENTITLEMENTS="" \ |
| 69 | + DEVELOPMENT_TEAM="" |
| 70 | +
|
| 71 | + # An .ipa is a zip with the .app inside a top-level Payload/ directory and |
| 72 | + # nothing else. Signing is the only thing this is missing. |
| 73 | + - name: package ipa |
| 74 | + run: | |
| 75 | + set -eux |
| 76 | + app=$(find build/pixity.xcarchive/Products/Applications -maxdepth 1 -name '*.app' | head -1) |
| 77 | + test -n "$app" |
| 78 | + rm -rf Payload && mkdir Payload |
| 79 | + cp -R "$app" Payload/ |
| 80 | + zip -qry pixity-unsigned.ipa Payload |
| 81 | + ls -lh pixity-unsigned.ipa |
| 82 | +
|
| 83 | + - uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: ios-unsigned-ipa |
| 86 | + path: pixity-unsigned.ipa |
| 87 | + if-no-files-found: error |
0 commit comments