hex/.github/workflows/release-ios.yml
Ryan Vogel 2eb91847a6 ci: run the shared keyboard core's checks, and cut an iOS beta when it changes
What changed
- New workflow .github/workflows/keyboard-core.yml: on pull requests that touch
  crates/keyboard or the files its tests read (the typing models and
  never-suggest.tsv), run cargo fmt --check, clippy with warnings as errors and
  the tests, with the toolchain crates/keyboard pins. macOS runner, because the
  swipe parity fixture stores costs bit for bit from Apple's libm.
- release-ios.yml: the "Cut iOS prerelease" diff now includes crates/keyboard,
  so a change to the core alone still cuts a TestFlight build.

Why
The swipe decoder moves into crates/keyboard in #2309. No CI job runs that
crate's tests today, and a core-only change would never reach TestFlight. The
pull request's author cannot edit .github, so these land separately.

A separate workflow instead of a job in compile.yml: compile.yml runs on every
desktop change, and this job is only useful when the keyboard core or its test
inputs change. compile.yml is unchanged.

Verified
actionlint passes on both files apart from the blacksmith runner label it does
not know, which compile.yml already uses. The toolchain line read by the job's
sed gives 1.99.1 from #2309's rust-toolchain.toml. The job itself first runs on
#2309 once this is on dev.
2026-11-22 09:42:44 -05:00

50 lines
1.8 KiB
YAML

name: Release Hex Mobile
# An ios-beta-* tag is the Xcode Cloud start condition. Cloud owns signing,
# build numbers, and distribution to Hex Internal.
on:
workflow_dispatch:
schedule:
- cron: "0 0,17,18,23 * * *"
permissions:
contents: write
concurrency:
group: release-hex-mobile
cancel-in-progress: false
jobs:
release:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check release window
id: window
run: |
hour=$(TZ=America/Chicago date +%H)
if [[ "$GITHUB_EVENT_NAME" == workflow_dispatch || "$hour" == 12 || "$hour" == 18 ]]; then
echo "cut=true" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
if: steps.window.outputs.cut == 'true'
with:
fetch-depth: 0
persist-credentials: false
- name: Cut iOS prerelease
if: steps.window.outputs.cut == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
previous=$(git describe --tags --match 'ios-beta-*' --abbrev=0 HEAD 2>/dev/null || :)
if [[ -n "$previous" ]] && git diff --quiet "$previous" HEAD -- ios crates/keyboard app/AppIcon.icon tests/fixtures/vocabulary/audio/term-hex-1.wav; then
echo "No mobile changes since $previous." >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
sha=$(git rev-parse HEAD)
tag="ios-beta-${sha:0:12}"
gh release create "$tag" --repo "$GITHUB_REPOSITORY" --target "$sha" \
--title "Hex Mobile · ${sha:0:12}" --prerelease --latest=false \
--notes "Internal iOS beta from \`$sha\`. Xcode Cloud builds and distributes it to Hex Internal."
echo "Cut $tag at $sha." >> "$GITHUB_STEP_SUMMARY"