forked from openMF/mobile-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor GitHub Actions workflows
- Updated workflows to use local actions instead of remote actions. - Added a new input variable `build_ios` to control iOS build. - Updated iOS Firebase deployment workflow to use `tester_groups` input. - Refactored input variable names for keystore and alias passwords for consistency. - Removed unused input variables and dependencies. - Simplified iOS Firebase deployment by removing release notes generation and versioning steps.
- Loading branch information
Showing
9 changed files
with
67 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,25 +12,13 @@ inputs: | |
firebase_creds: | ||
description: 'Firebase credentials' | ||
required: true | ||
github_token: | ||
description: 'GitHub token' | ||
required: true | ||
target_branch: | ||
description: 'Target branch for deployment' | ||
tester_groups: | ||
description: 'Firebase Tester Group' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up Java development environment | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'zulu' # Use Zulu distribution of OpenJDK | ||
java-version: '17' # Use Java 17 version | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
# Cache Gradle dependencies to speed up builds | ||
- uses: actions/cache@v3 | ||
with: | ||
|
@@ -54,72 +42,23 @@ runs: | |
bundle exec fastlane add_plugin firebase_app_distribution | ||
bundle exec fastlane add_plugin increment_build_number | ||
# Generate version number | ||
- name: Generate Release Number | ||
id: rel_number | ||
shell: bash | ||
run: | | ||
./gradlew versionFile | ||
COMMITS=`git rev-list --count HEAD` | ||
TAGS=`git tag | grep -v beta | wc -l` | ||
VC=$(((COMMITS+TAGS) << 1)) | ||
echo "version-code=$VC" >> $GITHUB_OUTPUT | ||
VERSION=`cat version.txt` | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Generate Release Notes | ||
uses: actions/github-script@v7 | ||
id: release-notes | ||
with: | ||
github-token: ${{ inputs.github_token }} | ||
script: | | ||
try { | ||
// Get latest release tag | ||
const latestRelease = await github.rest.repos.getLatestRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
const previousTag = latestRelease.data.tag_name; | ||
// Generate release notes | ||
const params = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag_name: '${{ steps.rel_number.outputs.version }}', | ||
target_commitish: '${{ inputs.target_branch }}' | ||
}; | ||
const { data } = await github.rest.repos.generateReleaseNotes(params); | ||
const changelog = data.body.replaceAll('`', '\'').replaceAll('"', '\''); | ||
// Write changelog files | ||
const fs = require('fs'); | ||
fs.writeFileSync('${{ inputs.ios_package_name }}/changelogGithub', changelog); | ||
// Generate beta changelog | ||
const { execSync } = require('child_process'); | ||
execSync('git log --format="* %s" HEAD^..HEAD > ${{ inputs.ios_package_name }}/changelogBeta'); | ||
return changelog; | ||
} catch (error) { | ||
console.error('Error generating release notes:', error); | ||
return ''; | ||
} | ||
- name: Inflate Secrets | ||
shell: bash | ||
env: | ||
GOOGLE_SERVICES: ${{ inputs.google_services }} | ||
FIREBASE_CREDS: ${{ inputs.firebase_creds }} | ||
run: | | ||
mkdir -p ${{ github.workspace }}/secrets | ||
mkdir -p secrets | ||
# Inflate Firebase credentials | ||
touch ${{ github.workspace }}/secrets/firebaseAppDistributionServiceCredentialsFile.json | ||
echo $FIREBASE_CREDS > ${{ github.workspace }}/secrets/firebaseAppDistributionServiceCredentialsFile.json | ||
touch secrets/firebaseAppDistributionServiceCredentialsFile.json | ||
echo $FIREBASE_CREDS | base64 --decode > secrets/firebaseAppDistributionServiceCredentialsFile.json | ||
- name: Upload iOS App to Firebase Distribution | ||
shell: bash | ||
run: bundle exec fastlane ios deploy_on_firebase | ||
run: bundle exec fastlane ios deploy_on_firebase \ | ||
serviceCredsFile:secrets/firebaseAppDistributionServiceCredentialsFile.json \ | ||
groups:${{ inputs.tester_groups }} | ||
|
||
- name: Upload iOS Artifact | ||
uses: actions/upload-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,11 @@ on: | |
default: false | ||
description: Publish Android App On Play Store | ||
|
||
build_ios: | ||
type: boolean | ||
default: false | ||
description: Build iOS App | ||
|
||
# Toggle for iOS App Store publishing | ||
publish_ios: | ||
type: boolean | ||
|
@@ -57,15 +62,15 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: Build Android App | ||
uses: openMF/kmp-build-android-app[email protected] | ||
uses: ./.github/actions/build-android-app | ||
with: | ||
android_package_name: mifospay-android | ||
build_type: 'Release' | ||
google_services: ${{ secrets.GOOGLESERVICES }} | ||
key_store: ${{ secrets.ORIGINAL_KEYSTORE_FILE }} | ||
key_store_password: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }} | ||
key_store_alias: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }} | ||
key_store_alias_password: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }} | ||
keystore: ${{ secrets.ORIGINAL_KEYSTORE_FILE }} | ||
keystore_password: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }} | ||
keystore_alias: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }} | ||
keystore_alias_password: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }} | ||
|
||
# Publish Android app on Firebase App Distribution | ||
publish_android_on_firebase: | ||
|
@@ -79,17 +84,17 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: Publish Android App on Firebase | ||
uses: openMF/kmp-android-firebase[email protected] | ||
uses: ./.github/actions/android-firebase | ||
with: | ||
android_package_name: mifospay-android | ||
|
||
keystore_file: ${{ secrets.ORIGINAL_KEYSTORE_FILE }} | ||
keystore_password: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }} | ||
key_alias: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }} | ||
key_password: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }} | ||
keystore_alias: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }} | ||
keystore_alias_password: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }} | ||
|
||
google_services: ${{ secrets.GOOGLESERVICES }} | ||
firebase_creds: ${{ secrets.FIREBASECREDS }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
target_branch: ${{ inputs.target_branch }} | ||
|
||
# Publish Android app on Play Store | ||
publish_android_on_playstore: | ||
|
@@ -104,16 +109,16 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: Promote Android App to Beta or Internal | ||
uses: openMF/kmp-publish-android-on-playstore-beta[email protected] | ||
uses: ./.github/actions/android-promote-beta | ||
with: | ||
release_type: ${{ inputs.release_type }} | ||
android_package_name: mifospay-android | ||
google_services: ${{ secrets.GOOGLESERVICES }} | ||
playstore_creds: ${{ secrets.PLAYSTORECREDS }} | ||
keystore_file: ${{ secrets.UPLOAD_KEYSTORE_FILE }} | ||
keystore_password: ${{ secrets.UPLOAD_KEYSTORE_FILE_PASSWORD }} | ||
key_alias: ${{ secrets.UPLOAD_KEYSTORE_ALIAS }} | ||
key_password: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }} | ||
keystore_alias: ${{ secrets.UPLOAD_KEYSTORE_ALIAS }} | ||
keystore_alias_password: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }} | ||
|
||
# iOS Build Job | ||
build_ios: | ||
|
@@ -124,7 +129,8 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Build iOS App | ||
uses: openMF/[email protected] | ||
if: inputs.build_ios | ||
uses: ./.github/actions/build-ios | ||
|
||
# Firebase Distribution Job for iOS | ||
publish_ios_app_to_firebase: | ||
|
@@ -138,12 +144,11 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Deploy iOS App to Firebase | ||
uses: openMF/kmp-publish-ios-on-firebase[email protected] | ||
uses: ./.github/actions/ios-firebase | ||
with: | ||
ios_package_name: mifospay-ios | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
ios_package_name: ${{ inputs.ios_package_name }} | ||
firebase_creds: ${{ secrets.FIREBASECREDS }} | ||
target_branch: ${{ inputs.target_branch }} | ||
tester_groups: 'mifos-wallet-testers' | ||
|
||
# App Store Publishing Job | ||
publish_ios_app_to_app_center: | ||
|