Skip to content

Adds CI for the Internal Beta build with the Debug Menu available #116

Adds CI for the Internal Beta build with the Debug Menu available

Adds CI for the Internal Beta build with the Debug Menu available #116

Workflow file for this run

name: CI - main
on:
push:
branches:
- main
workflow_dispatch:
inputs:
build-version:
description: "Version Name Override - e.g. '2024.8.1'"
type: string
build-number:
description: "Version Number Override - e.g. '1021'"
type: number
patch_version:
description: "Patch Version Override - e.g. '999'"
type: string
env:
XCODE_VERSION: '15.4'
INTERNAL_PATCH_NUMBER: 999
jobs:
resolve-values:
name: "Resolve values"
runs-on: ubuntu-latest
outputs:
build_variant: ${{ steps.calculate.outputs.variant }}
build_version: ${{ steps.calculate.outputs.version }}
build_number: ${{ steps.calculate.outputs.build_number }}
steps:
- name: Log inputs to job summary
run: |
echo "<details><summary>Workflow Inputs</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
echo '${{ toJson(inputs) }}' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
- name: Calculate version
if: ${{ !inputs.build-version && !inputs.build-number }}
uses: bitwarden/ios/.github/actions/dispatch-and-download@main
id: dispatch-version
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ios
owner: bitwarden
workflow: _version.yml
workflow_inputs: '{"base_version_number": "1000", "version_name": "${{ inputs.build-version }}", "version_number": "${{ inputs.build-number }}", "patch_number": "${{ inputs.patch_number }}"}'
- name: Read version info
id: version_info
run: |
# test if dispatch-version was skipped. In that case, creates the same .json file expected by the Upload artifact step
if [ ! -f version-info/version_info.json ]; then
json='{
"version_number": "${{ inputs.build-number }}",
"version_name": "${{ inputs.build-version }}"
}'
echo "$json" > version-info/version_info.json
fi
content=$(cat version-info/version_info.json)
echo "version_name=$(echo $content | jq -r .version_name)" >> $GITHUB_OUTPUT
echo "version_number=$(echo $content | jq -r .version_number)" >> $GITHUB_OUTPUT
- name: Upload version info artifact
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: version-info
path: version-info/version_info.json
build-public:
name: Build Public Apps
needs: resolve-values
uses: bitwarden/ios/.github/workflows/build.yml@main
strategy:
matrix:
variant: [Beta, Production]
with:
build-variant: ${{ matrix.variant }}
build-version: ${{ needs.resolve-values.outputs.build_version }}
build-number: ${{ needs.resolve-values.outputs.build_number }}
xcode-version: ${{ env.XCODE_VERSION }}
secrets: inherit
build-internal-beta:
name: Build Internal Beta
runs-on: macos-14
needs: resolve-values
steps:
- name: Set patch version for internal builds
id: fix-patch-version
run: |
version_name=${{ needs.resolve-values.outputs.build_version }}
internal_version_name="${version_name%.*}.${{ env.INTERNAL_PATCH_NUMBER }}"
echo "version_name=$internal_version_name" >> $GITHUB_OUTPUT
echo "::warning::Internal version name: $internal_version_name"
- name: Build
uses: bitwarden/ios/.github/workflows/build.yml@main
with:
build-variant: Beta
build-version: ${{ steps.fix-patch-version.outputs.version_name }}
build-number: ${{ needs.resolve-values.outputs.build_number }}
xcode-version: ${{ env.XCODE_VERSION }}
compiler-flags: "DEBUG_MENU"
secrets: inherit