CI/CD Integration
Automate Norrix builds in your CI/CD pipeline.
Setup
1. Create an API Key
- Go to Dashboard → Settings → API Keys
- Click Create API Key
- Name it (e.g., “GitHub Actions”)
- Select scopes:
build,submit,update - 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/cli4. Run Non-Interactive
Use -n or --non-interactive flag:
norrix build ios release -nNon-Interactive Mode
The -n flag:
- Skips all interactive prompts
- Uses config file values
- Requires explicit
--orgif not previously set
norrix build ios release -n --org $ORG_IDEnvironment 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.jsonBuild-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:
- mainCircleCI 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: mainNx 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 $VERSIONNotifications
Use webhooks to notify on build completion:
- Configure webhook in dashboard
- Point to Slack, Discord, or custom endpoint
- Receive build status notifications