Skip to content

feat: Migrating ApplicationManifest & ApplicationManager to Swift #153

feat: Migrating ApplicationManifest & ApplicationManager to Swift

feat: Migrating ApplicationManifest & ApplicationManager to Swift #153

Workflow file for this run

name: Create an airborne release
on:
pull_request:
types: [closed]
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tag-release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main'
outputs:
version: ${{ steps.git_tag.outputs.version }}
is_new_version: ${{ steps.git_tag.outputs.is_new_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.89.0
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- name: install cargo-edit to perform set-version
uses: baptiste0928/cargo-install@v2.2.0
with:
crate: cargo-edit
version: "0.13.6"
- name: install cocogitto
uses: baptiste0928/cargo-install@v2.2.0
with:
crate: cocogitto
version: "6.3.0"
- name: Install SSH key
env:
DEPLOY_KEY: ${{ secrets.AIRBORNE_DEPLOY_KEY }}
run: |
# create .ssh
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# write private key
echo "$DEPLOY_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# ensure github host key is known (avoid StrictHostKeyChecking prompt)
ssh-keyscan github.com >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Get current version
id: current_version
shell: bash
run: |
current_version=`cog -v get-version || echo "0.0.0"`
echo "current_version=$current_version" >> $GITHUB_OUTPUT
- name: Semver release
shell: bash
run: |
git config user.email "airborne_bot@juspay.in"
git config user.name "Airborne Bot"
cog bump --auto --skip-ci
- name: Set latest tag
id: git_tag
shell: bash
run: |
current_version=${{ steps.current_version.outputs.current_version }}
version=`cog -v get-version`
echo "version=$version" >> $GITHUB_OUTPUT
if [ "$version" != "$current_version" ]; then
echo "is_new_version=true" >> $GITHUB_OUTPUT
echo "New version detected: $current_version -> $version"
else
echo "is_new_version=false" >> $GITHUB_OUTPUT
echo "No version change detected: $version"
fi
- name: Push code to main
shell: bash
if: steps.git_tag.outputs.is_new_version == 'true'
run: |
git push origin main
git push origin --tags
server-docker-build:
needs: tag-release
permissions:
contents: read
packages: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
strategy:
max-parallel: 5
matrix:
include:
- platform: linux/amd64
tag: linux-amd64
os: ubuntu-latest
- platform: linux/arm64
tag: linux-arm64
os: ubuntu-24.04-arm
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push production image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: airborne_server/Dockerfile
tags: ghcr.io/${{ github.repository }}-server:${{ needs.tag-release.outputs.version }}-${{ matrix.tag }}
server-create-manifest:
needs: [tag-release, server-docker-build]
permissions:
contents: read
packages: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest for multi-arch image
run: |
docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-server:${{ needs.tag-release.outputs.version }} \
ghcr.io/${{ github.repository }}-server:${{ needs.tag-release.outputs.version }}-linux-amd64 \
ghcr.io/${{ github.repository }}-server:${{ needs.tag-release.outputs.version }}-linux-arm64
docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-server:latest \
ghcr.io/${{ github.repository }}-server:${{ needs.tag-release.outputs.version }}-linux-amd64 \
ghcr.io/${{ github.repository }}-server:${{ needs.tag-release.outputs.version }}-linux-arm64
analytics-docker-build:
needs: [tag-release]
permissions:
contents: read
packages: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
strategy:
max-parallel: 5
matrix:
include:
- platform: linux/amd64
tag: linux-amd64
os: ubuntu-latest
- platform: linux/arm64
tag: linux-arm64
os: ubuntu-24.04-arm
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push production image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: airborne_analytics_server/Dockerfile
tags: ghcr.io/${{ github.repository }}-analytics-server:${{ needs.tag-release.outputs.version }}-${{ matrix.tag }}
analytics-create-manifest:
needs: [tag-release, analytics-docker-build]
permissions:
contents: read
packages: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest for multi-arch image
run: |
docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-analytics-server:${{ needs.tag-release.outputs.version }} \
ghcr.io/${{ github.repository }}-analytics-server:${{ needs.tag-release.outputs.version }}-linux-amd64 \
ghcr.io/${{ github.repository }}-analytics-server:${{ needs.tag-release.outputs.version }}-linux-arm64
docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-analytics-server:latest \
ghcr.io/${{ github.repository }}-analytics-server:${{ needs.tag-release.outputs.version }}-linux-amd64 \
ghcr.io/${{ github.repository }}-analytics-server:${{ needs.tag-release.outputs.version }}-linux-arm64
dashboard-docker-build:
needs: [tag-release]
permissions:
contents: read
packages: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
strategy:
max-parallel: 5
matrix:
include:
- platform: linux/amd64
tag: linux-amd64
os: ubuntu-latest
- platform: linux/arm64
tag: linux-arm64
os: ubuntu-24.04-arm
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push production image
uses: docker/build-push-action@v6
with:
push: true
context: ./airborne_dashboard
file: ./airborne_dashboard/Dockerfile
tags: ghcr.io/${{ github.repository }}-dashboard:${{ needs.tag-release.outputs.version }}-${{ matrix.tag }}
dashboard-create-manifest:
needs: [tag-release, dashboard-docker-build]
permissions:
contents: read
packages: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest for multi-arch image
run: |
docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-dashboard:${{ needs.tag-release.outputs.version }} \
ghcr.io/${{ github.repository }}-dashboard:${{ needs.tag-release.outputs.version }}-linux-amd64 \
ghcr.io/${{ github.repository }}-dashboard:${{ needs.tag-release.outputs.version }}-linux-arm64
docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-dashboard:latest \
ghcr.io/${{ github.repository }}-dashboard:${{ needs.tag-release.outputs.version }}-linux-amd64 \
ghcr.io/${{ github.repository }}-dashboard:${{ needs.tag-release.outputs.version }}-linux-arm64
publish-to-maven-central:
needs: [tag-release]
permissions:
contents: read
id-token: write
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.tag-release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Filter paths
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
hyper_ota:
- 'airborne_sdk_android/hyper-ota/**'
hyper_eta_react:
- 'airborne_sdk_android/hyper-eta-react/**'
- name: Set up Temurin JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Grant execute for Gradle wrapper
run: chmod +x gradlew
working-directory: airborne_sdk_android
- name: Import GPG
run: |
echo "VERSION=${{ env.VERSION }}" >> $GITHUB_ENV
echo "${SIGNING_KEY}" | base64 -d > /tmp/key.asc
gpg --batch --import /tmp/key.asc
# Export the decoded key for Gradle
echo "DECODED_SIGNING_KEY<<EOF" >> $GITHUB_ENV
echo "${SIGNING_KEY}" | base64 -d >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
# Publish aggregation (both modules). nmcp builds a single ZIP and uploads to Portal API
- name: Publish to Maven Central (Central Portal)
working-directory: airborne_sdk_android
run: ./gradlew --no-daemon publishAggregationToCentralPortal
env:
# Central Portal token (username/password pair)
SONATYPE_MAVEN_USERNAME: ${{ secrets.SONATYPE_MAVEN_USERNAME }}
SONATYPE_MAVEN_PASSWORD: ${{ secrets.SONATYPE_MAVEN_PASSWORD }}
# Gradle signing properties (nmcp uses existing publications)
ORG_GRADLE_PROJECT_signingKey: ${{ env.DECODED_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
publish-to-npm:
needs: [tag-release]
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.tag-release.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- uses: actions/setup-node@v4
with:
node-version: "24.11.0"
registry-url: "https://registry.npmjs.org"
- name: Publish airborne-server-sdk
working-directory: airborne_server_clients/javascript/sdk
run: |
npm ci
npm publish --access public
- name: Publish airborne-core-cli
working-directory: airborne-core-cli
run: |
sed -i "s|\"airborne-server-sdk\": \"file:../airborne_server_clients/javascript/sdk\"|\"airborne-server-sdk\": \"*\"|" package.json
npm ci
npm publish --access public
- name: Publish airborne-devkit
working-directory: airborne_cli
run: |
sed -i "s|\"airborne-core-cli\": \"file:../airborne-core-cli\"|\"airborne-core-cli\": \"*\"|" package.json
npm ci
npm publish --access public
- name: Publish airborne-react-native
working-directory: airborne-react-native
run: |
sed -i "s|\"airborne-devkit\": \"file:../airborne_cli\"|\"airborne-devkit\": \"*\"|" package.json
npm ci
npm publish --access public
release:
permissions:
contents: write
needs:
[
tag-release,
server-create-manifest,
analytics-create-manifest,
dashboard-create-manifest,
publish-to-maven-central,
publish-to-npm,
]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
with:
draft: true