Skip to Content
Platform GuidesCI/CD Integration

CI/CD Integration

Automate Norrix builds in your CI/CD pipeline.

Setup

1. Create an API Key

  1. Go to Dashboard → Settings → API Keys 
  2. Click Create API Key
  3. Name it (e.g., “GitHub Actions”)
  4. Select scopes: build, submit, update
  5. Copy the key immediately

2. Store as Secret

Add NORRIX_API_KEY to your CI secrets:

  • GitHub: Settings → Secrets → Actions
  • GitLab: Settings → CI/CD → Variables
  • CircleCI: Project Settings → Environment Variables

3. Install CLI in CI

npm install -g @norrix/cli

4. Run Non-Interactive

Use -n or --non-interactive flag:

norrix build ios release -n

Non-Interactive Mode

The -n flag:

  • Skips all interactive prompts
  • Uses config file values
  • Requires explicit --org if not previously set
norrix build ios release -n --org $ORG_ID

Environment Variables

Secrets in CI

Store sensitive values as CI secrets and set via Norrix:

# In a setup job or script norrix env set APPLE_PASSWORD $APPLE_PASSWORD -v secret norrix env set-file google-services.json ./android/google-services.json

Build-Time Injection

Variables set via norrix env set are automatically injected during cloud builds.


GitHub Actions Example

name: Build and Deploy on: push: branches: [main] workflow_dispatch: jobs: build-ios: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Install Norrix CLI run: npm install -g @norrix/cli - name: Build iOS run: norrix build ios release appstore -n env: NORRIX_API_KEY: ${{ secrets.NORRIX_API_KEY }} - name: Wait for build run: | BUILD_ID=$(norrix build ios release -n --json | jq -r '.id') while true; do STATUS=$(norrix build-status $BUILD_ID --json | jq -r '.status') if [ "$STATUS" = "success" ]; then echo "Build succeeded!" break elif [ "$STATUS" = "failed" ]; then echo "Build failed!" exit 1 fi sleep 30 done env: NORRIX_API_KEY: ${{ secrets.NORRIX_API_KEY }} build-android: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Install Norrix CLI run: npm install -g @norrix/cli - name: Build Android run: norrix build android release -n env: NORRIX_API_KEY: ${{ secrets.NORRIX_API_KEY }}

GitLab CI Example

stages: - build variables: NODE_VERSION: '20' .norrix-setup: before_script: - npm install -g @norrix/cli - npm ci build-ios: extends: .norrix-setup stage: build script: - norrix build ios release appstore -n only: - main build-android: extends: .norrix-setup stage: build script: - norrix build android release -n only: - main

CircleCI Example

version: 2.1 jobs: build: docker: - image: cimg/node:20.0 steps: - checkout - run: name: Install dependencies command: npm ci - run: name: Install Norrix CLI command: npm install -g @norrix/cli - run: name: Build iOS command: norrix build ios release -n - run: name: Build Android command: norrix build android release -n workflows: build-and-deploy: jobs: - build: filters: branches: only: main

Nx Workspace in CI

For Nx monorepos, specify the project:

- name: Build specific project run: norrix build ios release -n --project my-mobile-app --config prod env: NORRIX_API_KEY: ${{ secrets.NORRIX_API_KEY }}

OTA Updates in CI

Publish OTA updates on merge to main:

deploy-ota: runs-on: ubuntu-latest needs: build if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - name: Install Norrix CLI run: npm install -g @norrix/cli - name: Publish iOS update run: norrix update ios ${{ github.event.release.tag_name }} -n env: NORRIX_API_KEY: ${{ secrets.NORRIX_API_KEY }} - name: Publish Android update run: norrix update android ${{ github.event.release.tag_name }} -n env: NORRIX_API_KEY: ${{ secrets.NORRIX_API_KEY }}

Best Practices

Cache Dependencies

- uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}

Parallel Builds

Run iOS and Android builds in parallel jobs.

Version from Git

Use git tags or commit SHA for versions:

- name: Get version run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV - name: Build with version run: norrix build ios release -n --version $VERSION

Notifications

Use webhooks to notify on build completion:

  1. Configure webhook in dashboard
  2. Point to Slack, Discord, or custom endpoint
  3. Receive build status notifications