name: Publish Over-the-Air Update
on:
  workflow_dispatch:

jobs:
  publish-ota-update:
    runs-on: macos-15
    steps:
      - name: 🛒 Checkout
        uses: actions/checkout@v6
        with:
          token: ${{ secrets.SIGNING_REPO_PAT }}

      - name: 🖥 Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: 1.3.4

      - name: 🥟 Run bun install
        run: bun i

      - name: 👩‍💻 Configure Git
        run: |
          git config --global user.email "violet@cosmonautical.cloud"
          git config --global user.name "anultravioletaurora"

      - name: 🤖 Publish Android Update
        run: bun run sendOTA:android
        env:
          SIGNING_REPO_PAT: ${{ secrets.SIGNING_REPO_PAT }}

      - name: 🍎 Publish iOS Update
        run: bun run sendOTA:iOS
        env:
          SIGNING_REPO_PAT: ${{ secrets.SIGNING_REPO_PAT }}
