Skip to main content
This page is the full path from the moment the authentication code reaches develop until the version is published and mandatory in both stores. The detail of every console lives in the repository runbook, docs/operations/oauth-providers.md, which is the source of truth.
After the merge to develop the alpha tag is created. In each environment, development, certification and production, Apple, Supabase and 1Password are configured first, then the Release Train runs, then the flags are synced and turned on, and finally the environment is tested. Production ends with App Review and the mandatory release.

Rollout order per environment

The three ordering rules

One environment at a time

development → certification → production. Do not move on without testing the previous one.

Consoles before the train

The Release Train starts with Sync Env and ends with the EAS build. Apple, Supabase and 1Password must be ready before it runs.

Flags last

A flag turned on before the deploy shows the button, but the sign-in fails.

How a tag reaches each environment

Merging into develop deploys nothing: release.yml only creates the YYYY.M.P-alpha.N tag and its GitHub Release. Each environment is rolled out by hand with the Release Train workflow, which always starts from a tag. The train runs, in order: Sync Env → Deploy → database migrations and IdP → Wave-0 QA → EAS builds. The EAS build takes its version from the tag, so the version in app.config.js is not bumped by hand.

Step 0 · Apple Developer, once

These two tasks cover all three environments and are done before the first train.
1

Capability on the five App IDs

Certificates, Identifiers & Profiles → Identifiers → enable Sign in with Apple on com.maihuego.application.dev, .sandbox, .cert, .preprod and com.maihuego.application.
  • Primaries (Enable as a primary App ID): .dev, .cert and the production one.
  • .sandbox is grouped with .dev, and .preprod with the production one, so a person sees a single consent per environment.
  • On each primary, Server-to-Server Notification Endpoint = https://<environment horizon-api>/api/v3/auth/oauth/apple/notifications.
2

Private Email Relay

Services → Sign in with Apple for Email Communication → register maihuego.com, contacto@maihuego.com, the Resend return-path domain and the SMTP sender of each Supabase project. Without it, mail to @privaterelay.appleid.com addresses bounces (magic links and security e-mails included). Apple requires SPF; DKIM is recommended.
If the capability is not enabled before the train, the EAS build ships without the entitlement and the native Apple sign-in fails on iOS.

Step 1 · Development

1

Apple: Services ID and key

  • Services ID com.maihuego.signin.dev, with Sign in with Apple → Primary App ID .dev, domain development.supabase.bbrands.io and Return URL https://development.supabase.bbrands.io/auth/v1/callback.
  • .p8 key “Sign in with Apple development”, bound to the primary. It downloads only once: write down the Key ID and the Team ID and keep the file in 1Password.
2

Supabase development

  • Authentication → Sign In / Providers → Apple: enable.
    • Client IDs: the Services ID and the environment bundle IDs, comma separated (com.maihuego.signin.dev,com.maihuego.application.dev,com.maihuego.application.sandbox). Without the bundle ID the native iOS sign-in fails.
    • Secret Key: the ES256 JWT signed with the .p8 (six months at most; the runbook has the script).
  • URL Configuration → Redirect URLs: add https://development.api.bbrands.io/api/v3/auth/login/oauth/apple/callback**.
  • E-mail link expiry (MAILER_OTP_EXP) = 3600 seconds.
3

1Password development

The order of APPLE_CLIENT_IDS is not the Supabase order. Supabase lists the Services ID first; horizon-api expects the bundle IDs first and the Services ID last (env-validator.ts documents it that way, and the Services ID is taken from the last entry when APPLE_SERVICES_ID is missing). Always set APPLE_SERVICES_ID explicitly.
To generate the keyring:
4

Release Train

Actions → Release Train → “Use workflow from” = the alpha tag → development → type RELEASE. The train syncs the variables, deploys, runs the migration (auth_provider_credential and the provider and is_private_email columns) and starts the development EAS build.
5

Flags

Horizon Enterprise (development) → Capabilities → Sync. It creates the authenticate category with authenticate-oauth-google, authenticate-oauth-apple and authenticate-oauth-microsoft turned off, and deletes the old maihuego-application-oauth-* keys. Turn all three on.
6

Smoke test

Web: e-mail sign-in on horizon-authenticate, the Apple button and the portal password banner. App: the development build on iOS and Android.

Step 2 · Certification

1

rc tag

pnpm pr:rc opens the develop → release PR; merging it creates the -rc.N tag.
2

Consoles

Repeat Apple (Services ID com.maihuego.signin.cert and its .p8), Supabase certification (Client IDs com.maihuego.signin.cert,com.maihuego.application.cert) and 1Password certification:
3

Release Train and flags

Train with the rc tag → certification (one approval). Then Sync and turn on the three flags.
4

Manual tests

With the TestFlight build and the internal APK, walk MT-01 to MT-11 of authenticate/oauth/05-test-plan.md and record the result there. For hidden e-mail, confirm in Resend that the magic link to the relay was delivered without a bounce.

Step 3 · Production

1

Stable tag

pnpm pr:release opens release → master; merging it creates the stable tag.
2

Consoles

Repeat Apple (Services ID com.maihuego.signin), Supabase production (com.maihuego.signin,com.maihuego.application,com.maihuego.application.preprod) and 1Password production:Double-check that AUTH_BFF_SERVER_TOKEN is the same in horizon-api and horizon-authenticate.
3

Release Train

Train with the stable tag → production (two approvals). The production EAS build is submitted to the stores automatically.
4

Production flags

Sync and turn on only authenticate-oauth-google and authenticate-oauth-apple. Microsoft stays off. Older app versions do not read these keys and show no provider.
5

App Review

In App Store Connect → App Review Information, leave the reviewer note and the demo account credentials (from 1Password, never in the repository), then Submit for Review.
6

Google Play

Once Apple approves, publish on Google Play so both stores carry the same version.
7

Mandatory release

With the version published in both stores: Horizon Enterprise → MaihueGO release → each store → mandatory. Check with the previous version that the answer carries update_required: true:
8

Rotation reminder

The Apple secret in Supabase expires after six months. Set a reminder at five months per environment. See Operations and maintenance.

Summary