Skip to content

feat(sdds-acore/icons): New icons were added from plasma v1.234.0 #354

feat(sdds-acore/icons): New icons were added from plasma v1.234.0

feat(sdds-acore/icons): New icons were added from plasma v1.234.0 #354

name: Build and Deploy to TestFlight
on:
push:
branches:
- main
workflow_dispatch:
inputs:
lane:
description: 'Choose the Fastlane lane to run'
required: true
default: 'build_and_upload'
demo_target:
description: 'Demo app target/theme to build'
required: true
default: 'default'
type: choice
options:
- default
- sddsserv
- plasmab2c
- plasmahomeds
skip_checks:
description: 'Skip checking other workflows status'
required: false
default: 'false'
type: boolean
repository_dispatch:
types: [publish-demo-app]
jobs:
build-and-deploy-main:
runs-on: macos-latest
environment: sdds
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Set up bundle
run: bundle install
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.SDDS_DEMO_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.SDDS_DEMO_P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.SDDS_DEMO_BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
chmod +x ./scripts/install_certificate_and_profile.sh
./scripts/install_certificate_and_profile.sh "$RUNNER_TEMP" "$BUILD_CERTIFICATE_BASE64" "$P12_PASSWORD" "$BUILD_PROVISION_PROFILE_BASE64" "$KEYCHAIN_PASSWORD"
- name: Install Fastlane
run: gem install fastlane
- name: Validate lane input
if: github.event_name == 'workflow_dispatch'
run: |
LANE="${{ github.event.inputs.lane || 'build_and_upload' }}"
if [[ "$LANE" != "build_and_upload" && "$LANE" != "update_build_version_before_release" ]]; then
echo "Invalid lane specified. Please choose either 'build_and_upload' or 'update_build_version_before_release'."
exit 1
fi
DEMO_TARGET="${{ github.event.inputs.demo_target || 'default' }}"
if [[ "$DEMO_TARGET" != "default" && "$DEMO_TARGET" != "sddsserv" && "$DEMO_TARGET" != "plasmab2c" && "$DEMO_TARGET" != "plasmahomeds" ]]; then
echo "Invalid demo_target specified. Please choose one of: default, sddsserv, plasmab2c, plasmahomeds."
exit 1
fi
- name: Run Fastlane
env:
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
DEMO_TARGET: ${{ github.event.inputs.demo_target || 'default' }}
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
fastlane ${{ github.event.inputs.lane || 'build_and_upload' }} demo_target:${{ github.event.inputs.demo_target || 'default' }} 2>&1 | tee fastlane_output.log
else
fastlane build_and_upload demo_target:default 2>&1 | tee fastlane_output.log
fi
build-and-deploy-pr:
runs-on: macos-latest
environment: sdds
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check required workflows status
if: ${{ github.event.inputs.skip_checks != 'true' }}
run: |
echo "Checking status of required workflows..."
# Get the current branch name
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
echo "Branch: $BRANCH_NAME"
# Check test workflow
TEST_STATUS=$(gh api repos/${{ github.repository }}/actions/workflows/test.yml/runs --jq '.workflow_runs[] | select(.head_branch == "'$BRANCH_NAME'" and .head_sha == "'${{ github.sha }}'") | .conclusion' | head -1)
echo "Test workflow status: $TEST_STATUS"
# Check verify-snapshots workflow
SNAPSHOT_STATUS=$(gh api repos/${{ github.repository }}/actions/workflows/verify-snapshots.yml/runs --jq '.workflow_runs[] | select(.head_branch == "'$BRANCH_NAME'" and .head_sha == "'${{ github.sha }}'") | .conclusion' | head -1)
echo "Snapshot workflow status: $SNAPSHOT_STATUS"
# Check if both workflows passed
if [[ "$TEST_STATUS" == "success" && "$SNAPSHOT_STATUS" == "success" ]]; then
echo "✅ All required workflows passed"
else
echo "❌ Required workflows failed or not completed"
echo "Test: $TEST_STATUS, Snapshot: $SNAPSHOT_STATUS"
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}
- name: Skip checks (manual override)
if: ${{ github.event.inputs.skip_checks == 'true' }}
run: |
echo "⚠️ Skipping workflow status checks (manual override)"
echo "This build will proceed without verifying other workflows"
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Set up bundle
run: bundle install
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.SDDS_DEMO_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.SDDS_DEMO_P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.SDDS_DEMO_BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
chmod +x ./scripts/install_certificate_and_profile.sh
./scripts/install_certificate_and_profile.sh "$RUNNER_TEMP" "$BUILD_CERTIFICATE_BASE64" "$P12_PASSWORD" "$BUILD_PROVISION_PROFILE_BASE64" "$KEYCHAIN_PASSWORD"
- name: Install Fastlane
run: gem install fastlane
- name: Validate lane input
if: github.event_name == 'workflow_dispatch'
run: |
LANE="${{ github.event.inputs.lane || 'build_and_upload' }}"
if [[ "$LANE" != "build_and_upload" && "$LANE" != "update_build_version_before_release" ]]; then
echo "Invalid lane specified. Please choose either 'build_and_upload' or 'update_build_version_before_release'."
exit 1
fi
DEMO_TARGET="${{ github.event.inputs.demo_target || 'default' }}"
if [[ "$DEMO_TARGET" != "default" && "$DEMO_TARGET" != "sddsserv" && "$DEMO_TARGET" != "plasmab2c" && "$DEMO_TARGET" != "plasmahomeds" ]]; then
echo "Invalid demo_target specified. Please choose one of: default, sddsserv, plasmab2c, plasmahomeds."
exit 1
fi
- name: Run Fastlane
env:
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
DEMO_TARGET: ${{ github.event.inputs.demo_target || 'default' }}
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
fastlane ${{ github.event.inputs.lane || 'build_and_upload' }} demo_target:${{ github.event.inputs.demo_target || 'default' }} 2>&1 | tee fastlane_output.log
else
fastlane build_and_upload demo_target:default 2>&1 | tee fastlane_output.log
fi
- name: Extract build info
if: success()
run: ./scripts/extract_build_info.sh
- name: Comment on PR
if: success()
run: ./scripts/comment_pr.sh
env:
VERSION: ${{ env.VERSION }}
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
GH_TOKEN: ${{ github.token }}