Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 12 additions & 67 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
name: 'Build Android'
description: 'Builds Android app AAB and uploads manifest and AAB'
inputs:
type:
description: 'Build type: official or experimental'
required: true
BUILD_VERSION:
description: 'Build version for build'
required: true
BUGSNAG_KEY:
description: 'Bugsnag API key for build'
required: true
KEYSTORE_EXPERIMENTAL_BASE64:
description: 'Base64 encoded keystore for experimental build'
required: true
KEYSTORE_EXPERIMENTAL:
description: 'Keystore file name for experimental build'
required: true
KEYSTORE_EXPERIMENTAL_PASSWORD:
description: 'Keystore password for experimental build'
required: true
KEYSTORE_EXPERIMENTAL_ALIAS:
description: 'Keystore alias for experimental build'
required: true
GOOGLE_SERVICES_ANDROID:
description: 'Google services JSON for experimental build'
description: 'Google services JSON'
required: true
BUGSNAG_KEY_OFFICIAL:
description: 'Bugsnag API key for official build'
Expand Down Expand Up @@ -63,16 +45,11 @@ runs:
key: gradle-${{ hashFiles('android/**.gradle*', 'android/**/gradle-wrapper.properties') }}
restore-keys: |
gradle-

- name: Decode Keystore
working-directory: android/app
run: |
if [[ "${{ inputs.type }}" == "experimental" ]]; then
echo "${{ inputs.KEYSTORE_EXPERIMENTAL_BASE64 }}" | base64 -d > "${{ inputs.KEYSTORE_EXPERIMENTAL }}"
fi
if [[ "${{ inputs.type }}" == "official" ]]; then
echo "${{ inputs.KEYSTORE_OFFICIAL_BASE64 }}" | base64 -d > "${{ inputs.KEYSTORE_OFFICIAL }}"
fi
echo "${{ inputs.KEYSTORE_OFFICIAL_BASE64 }}" | base64 -d > "${{ inputs.KEYSTORE_OFFICIAL }}"
shell: bash

- name: Set gradle.properties
Expand All @@ -86,24 +63,12 @@ runs:
echo -e "newArchEnabled=true" >> ./gradle.properties
echo -e "hermesEnabled=true" >> ./gradle.properties
echo -e "VERSIONCODE=${{ inputs.BUILD_VERSION }}" >> ./gradle.properties

if [[ "${{ inputs.type }}" == "experimental" ]]; then
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
echo -e "BugsnagAPIKey=${{ inputs.BUGSNAG_KEY }}" >> ./gradle.properties
echo -e "KEYSTORE=${{ inputs.KEYSTORE_EXPERIMENTAL }}" >> ./gradle.properties
echo -e 'KEYSTORE_PASSWORD=${{ inputs.KEYSTORE_EXPERIMENTAL_PASSWORD }}' >> ./gradle.properties
echo -e "KEY_ALIAS=${{ inputs.KEYSTORE_EXPERIMENTAL_ALIAS }}" >> ./gradle.properties
echo -e 'KEY_PASSWORD=${{ inputs.KEYSTORE_EXPERIMENTAL_PASSWORD }}' >> ./gradle.properties
fi

if [[ "${{ inputs.type }}" == "official" ]]; then
echo -e "APPLICATION_ID=chat.rocket.android" >> ./gradle.properties
echo -e "BugsnagAPIKey=${{ inputs.BUGSNAG_KEY_OFFICIAL }}" >> ./gradle.properties
echo -e "KEYSTORE=${{ inputs.KEYSTORE_OFFICIAL }}" >> ./gradle.properties
echo -e 'KEYSTORE_PASSWORD=${{ inputs.KEYSTORE_OFFICIAL_PASSWORD }}' >> ./gradle.properties
echo -e "KEY_ALIAS=${{ inputs.KEYSTORE_OFFICIAL_ALIAS }}" >> ./gradle.properties
echo -e 'KEY_PASSWORD=${{ inputs.KEYSTORE_OFFICIAL_PASSWORD }}' >> ./gradle.properties
fi
echo -e "APPLICATION_ID=chat.rocket.android" >> ./gradle.properties
echo -e "BugsnagAPIKey=${{ inputs.BUGSNAG_KEY_OFFICIAL }}" >> ./gradle.properties
echo -e "KEYSTORE=${{ inputs.KEYSTORE_OFFICIAL }}" >> ./gradle.properties
echo -e 'KEYSTORE_PASSWORD=${{ inputs.KEYSTORE_OFFICIAL_PASSWORD }}' >> ./gradle.properties
echo -e "KEY_ALIAS=${{ inputs.KEYSTORE_OFFICIAL_ALIAS }}" >> ./gradle.properties
echo -e 'KEY_PASSWORD=${{ inputs.KEYSTORE_OFFICIAL_PASSWORD }}' >> ./gradle.properties
shell: bash

- name: Set Google Services JSON
Expand All @@ -116,36 +81,16 @@ runs:

- name: Build Android Release AAB
working-directory: android
run: |
if [[ "${{ inputs.type }}" == "experimental" ]]; then
./gradlew bundleExperimentalRelease
fi
if [[ "${{ inputs.type }}" == "official" ]]; then
./gradlew bundleOfficialRelease
fi
run: ./gradlew bundleOfficialRelease
shell: bash

- name: Upload sourcemaps/NDK symbols to Bugsnag
run: |
if [[ "${{ inputs.type }}" == "official" ]]; then
yarn bugsnag:upload-android --variant officialRelease --app-manifest android/app/build/intermediates/merged_manifests/officialRelease/processOfficialReleaseManifest/AndroidManifest.xml
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/officialRelease/app-official-release.aab
fi
if [[ "${{ inputs.type }}" == "experimental" ]]; then
yarn bugsnag:upload-android --variant experimentalRelease --app-manifest android/app/build/intermediates/merged_manifests/experimentalRelease/processExperimentalReleaseManifest/AndroidManifest.xml
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab
fi
yarn bugsnag:upload-android --variant officialRelease --app-manifest android/app/build/intermediates/merged_manifests/officialRelease/processOfficialReleaseManifest/AndroidManifest.xml
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/officialRelease/app-official-release.aab
shell: bash

- name: Upload Experimental AAB
if: ${{ inputs.type == 'experimental' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: android-aab-experimental
path: android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab

- name: Upload Official AAB
if: ${{ inputs.type == 'official' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: android-aab-official
Expand Down
65 changes: 5 additions & 60 deletions .github/actions/build-ios/action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: 'Build iOS'
description: 'Build iOS app'
inputs:
type:
description: 'Build type: official or experimental'
required: true
BUILD_VERSION:
description: 'Build version'
required: true
APP_STORE_CONNECT_API_KEY_BASE64:
description: 'Base64 encoded App Store Connect API Key'
required: true
BUGSNAG_KEY:
description: 'Bugsnag API Key'
required: true
MATCH_KEYCHAIN_NAME:
description: 'Match Keychain Name'
required: true
Expand All @@ -37,9 +31,6 @@ inputs:
GOOGLE_SERVICES_IOS:
description: 'Google service file for official version'
required: true
GOOGLE_SERVICES_IOS_EXPERIMENTAL:
description: 'Google service file for experimental version'
required: true

runs:
using: "composite"
Expand Down Expand Up @@ -71,7 +62,7 @@ runs:
restore-keys: |
pods-v1-

- name: pod install
- name: pod install
run: |
yarn pod-install
shell: bash
Expand All @@ -85,43 +76,21 @@ runs:
working-directory: ios
run: |
agvtool new-version -all ${{ inputs.BUILD_VERSION }}
if [[ ${{ inputs.type }} == "official" ]]; then
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey ${{ inputs.BUGSNAG_KEY_OFFICIAL }}" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey ${{ inputs.BUGSNAG_KEY_OFFICIAL }}" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./NotificationService/Info.plist
fi
if [[ ${{ inputs.type }} == "experimental" ]]; then
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey ${{ inputs.BUGSNAG_KEY }}" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey ${{ inputs.BUGSNAG_KEY }}" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./NotificationService/Info.plist
fi
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey ${{ inputs.BUGSNAG_KEY_OFFICIAL }}" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey ${{ inputs.BUGSNAG_KEY_OFFICIAL }}" ./ShareRocketChatRN/Info.plist
shell: bash

- name: Set Google Services
working-directory: ios
run: |
if [[ $APP_STORE_CONNECT_API_KEY_BASE64 ]]; then
if [[ ${{ inputs.type }} == "official" ]]; then
echo ${{ inputs.GOOGLE_SERVICES_IOS }} | base64 --decode > GoogleService-Info.plist
else
echo ${{ inputs.GOOGLE_SERVICES_IOS_EXPERIMENTAL }} | base64 --decode > GoogleService-Info.plist
fi
echo ${{ inputs.GOOGLE_SERVICES_IOS }} | base64 --decode > GoogleService-Info.plist
fi
shell: bash

- name: Build iOS app
working-directory: ios
run: |
if [[ ${{ inputs.type }} == "official" ]]; then
bundle exec fastlane ios build_official
fi
if [[ ${{ inputs.type }} == "experimental" ]]; then
bundle exec fastlane ios build_experimental
fi
run: bundle exec fastlane ios build_official
env:
MATCH_KEYCHAIN_NAME: ${{ inputs.MATCH_KEYCHAIN_NAME }}
MATCH_KEYCHAIN_PASSWORD: ${{ inputs.MATCH_KEYCHAIN_PASSWORD }}
Expand All @@ -133,42 +102,18 @@ runs:

- name: Upload IPA artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.type == 'experimental' }}
with:
name: ios-build-experimental
path: ios/Rocket.Chat.ipa

- name: Upload IPA artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.type == 'official' }}
with:
name: ios-build-official
path: ios/Rocket.Chat.ipa

- name: Upload Rocket.Chat.app.dSYM.zip
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.type == 'experimental' }}
with:
name: ios-build-experimental-dSYM
path: ios/Rocket.Chat.app.dSYM.zip

- name: Upload Rocket.Chat.app.dSYM.zip
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.type == 'official' }}
with:
name: ios-build-official-dSYM
path: ios/Rocket.Chat.app.dSYM.zip

- name: Upload RocketChatRN/Info.plist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.type == 'experimental' }}
with:
name: ios-build-experimental-info-plist
path: ios/RocketChatRN/Info.plist

- name: Upload RocketChatRN/Info.plist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.type == 'official' }}
with:
name: ios-build-official-info-plist
path: ios/RocketChatRN/Info.plist
31 changes: 5 additions & 26 deletions .github/actions/upload-android/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: 'Upload Android'
description: 'Downloads AAB + Manifest, uploads to Play Store'
inputs:
type:
description: 'Build type: official or experimental'
required: true
FASTLANE_GOOGLE_SERVICE_ACCOUNT:
description: 'Google service account key for upload'
required: true
Expand All @@ -17,19 +14,11 @@ inputs:
description: 'Trigger for build'
required: true
default: pr

runs:
using: "composite"
steps:
- name: Download Experimental AAB
if: ${{ inputs.type == 'experimental' }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: android-aab-experimental
path: android/app/build/outputs/bundle/experimentalRelease/

- name: Download Official AAB
if: ${{ inputs.type == 'official' }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: android-aab-official
Expand Down Expand Up @@ -72,34 +61,24 @@ runs:
working-directory: android
run: |
if [[ ${{ inputs.trigger }} == "pr" ]]; then
bundle exec fastlane android beta official:${{ inputs.type == 'official' }}
bundle exec fastlane android beta
fi
if [[ ${{ inputs.trigger }} == "develop" ]] && [[ ${{ inputs.type }} == 'experimental' ]]; then
bundle exec fastlane android experimental_production
fi
if [[ ${{ inputs.trigger }} == "develop" ]] && [[ ${{ inputs.type }} == 'official' ]]; then
if [[ ${{ inputs.trigger }} == "develop" ]]; then
bundle exec fastlane android official_open_testing
fi
shell: bash

- name: Leave a comment on PR
if: ${{ inputs.trigger == 'pr' }}
env:
GH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BUILD_TYPE: ${{ inputs.type }}
BUILD_VERSION: ${{ inputs.BUILD_VERSION }}
run: |
if [[ "$BUILD_TYPE" == "official" ]]; then
app_name="Rocket.Chat"
else
app_name="Rocket.Chat Experimental"
fi

gradle_file="android/app/build.gradle"
VERSION_NAME=$(grep versionName $gradle_file | head -n 1 | sed -E 's/.*versionName[[:space:]]+"([^"]+)".*/\1/')

version_info="$app_name $VERSION_NAME.$BUILD_VERSION"
version_info="Rocket.Chat $VERSION_NAME.$BUILD_VERSION"

message="**Android Build Available**"$'\n\n'"$version_info"

Expand Down
22 changes: 2 additions & 20 deletions .github/actions/upload-internal-android/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: 'Upload Android'
description: 'Downloads AAB + Manifest, uploads to Play Store'
inputs:
type:
description: 'Build type: official or experimental'
required: true
FASTLANE_GOOGLE_SERVICE_ACCOUNT:
description: 'Google service account key for upload'
required: true
Expand All @@ -21,15 +18,7 @@ inputs:
runs:
using: "composite"
steps:
- name: Download Experimental AAB
if: ${{ inputs.type == 'experimental' }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: android-aab-experimental
path: android/app/build/outputs/bundle/experimentalRelease/

- name: Download Official AAB
if: ${{ inputs.type == 'official' }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: android-aab-official
Expand All @@ -52,7 +41,7 @@ runs:
working-directory: android
run: |
set -o pipefail
output=$(bundle exec fastlane android internal_app_sharing official:${{ inputs.type == 'official' }} 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g")
output=$(bundle exec fastlane android internal_app_sharing 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g")

echo "$output"

Expand All @@ -78,21 +67,14 @@ runs:
env:
GH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BUILD_TYPE: ${{ inputs.type }}
BUILD_VERSION: ${{ inputs.BUILD_VERSION }}
run: |
if [[ -z "$INTERNAL_SHARING_URL" ]]; then
echo "No internal sharing URL found in env"
exit 1
fi

if [[ "$BUILD_TYPE" == "official" ]]; then
app_name="Rocket.Chat"
else
app_name="Rocket.Chat Experimental"
fi

version_info="$app_name $VERSION_NAME.$BUILD_VERSION"
version_info="Rocket.Chat $VERSION_NAME.$BUILD_VERSION"

message="**Android Build Available**"$'\n\n'"$version_info"$'\n\n'"Internal App Sharing: $INTERNAL_SHARING_URL"

Expand Down
Loading
Loading