Skip to content

Commit

Permalink
Merge pull request #69 from cuappdev/staging
Browse files Browse the repository at this point in the history
Publishing Backend URL fix
  • Loading branch information
thisjustin123 authored Nov 14, 2024
2 parents c65404e + 2ecfc3d commit 713a0be
Show file tree
Hide file tree
Showing 63 changed files with 4,101 additions and 106 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/publish-to-play-store-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Publish to Google Play Store Beta

on:
push:
branches: [ prod-test ]

jobs:
build:
runs-on: ubuntu-latest

env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
cache-read-only: false

- name: Create secrets.properties
run: |
echo "${{ secrets.SECRETS_PROPERTIES }}" > secrets.properties
# TODO: Add google services json

- name: Build with Gradle
id: build
run: ./gradlew build

- name: Build the app
id: buildRelease
run: ./gradlew bundleRelease

- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Upload AAB
id: uploadArtifact
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/bundle/release/app-release.aab

- name: Create service_account.json
id: createServiceAccount
run: echo '${{ secrets.PLAY_STORE_JSON }}' > service_account.json

- name: Deploy to Play Store (BETA)
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: ${{ secrets.PACKAGE_NAME }}
releaseFiles: "app/build/outputs/bundle/release/app-release.aab"
track: beta
whatsNewDirectory: whatsnew/

- name: Notify on Slack
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()
80 changes: 80 additions & 0 deletions .github/workflows/publish-to-play-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Publish to Google Play Store [PRODUCTION]

on:
push:
branches: [ prod ]

jobs:
build:
runs-on: ubuntu-latest

env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
cache-read-only: false

- name: Create secrets.properties
run: |
echo "${{ secrets.SECRETS_PROPERTIES }}" > secrets.properties
# TODO: Add google services json

- name: Build with Gradle
id: build
run: ./gradlew build

- name: Build the app
id: buildRelease
run: ./gradlew bundleRelease

- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Upload AAB
id: uploadArtifact
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/bundle/release/app-release.aab

- name: Create service_account.json
id: createServiceAccount
run: echo '${{ secrets.PLAY_STORE_JSON }}' > service_account.json

- name: Deploy to Play Store (PROD)
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: ${{ secrets.PACKAGE_NAME }}
releaseFiles: "app/build/outputs/bundle/release/app-release.aab"
track: production
whatsNewDirectory: whatsnew/

- name: Notify on Slack
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ captures/
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/*
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
Expand Down Expand Up @@ -83,3 +84,5 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

secrets.properties
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/graphql-settings.xml

This file was deleted.

40 changes: 0 additions & 40 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/migrations.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

22 changes: 17 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ plugins {
id "com.apollographql.apollo3" version "3.8.2"
}

def secretsPropertiesFile = rootProject.file('secrets.properties')
def secretsProperties = new Properties()
secretsProperties.load(new FileInputStream(secretsPropertiesFile))

android {
namespace 'com.cornellappdev.uplift'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.cornellappdev.uplift"
minSdk 28
targetSdk 34
versionCode 9
versionName "1.3-classes"
targetSdk 35
versionCode 13
versionName "1.4-backend-fix"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -22,9 +26,14 @@ android {
}

buildTypes {
debug {
buildConfigField("String", "BACKEND_URL", secretsProperties['DEV_ENDPOINT'])
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
buildConfigField("String", "BACKEND_URL", secretsProperties['PROD_ENDPOINT'])
}
}
compileOptions {
Expand All @@ -37,6 +46,7 @@ android {
}
buildFeatures {
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.3'
Expand All @@ -55,8 +65,10 @@ dependencies {
implementation 'androidx.activity:activity-compose:1.3.1'
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.5.1'
implementation 'androidx.compose.material:material:1.7.3'
implementation 'androidx.compose.material3:material3-android:1.3.0'
implementation 'androidx.core:core-ktx:+'
implementation 'androidx.compose.material3:material3-android:1.3.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
37 changes: 37 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.cornellappdev.uplift",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 10,
"versionName": "1.4",
"outputFile": "app-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
}
],
"minSdkVersionForDexing": 28
}
1 change: 1 addition & 0 deletions app/src/main/java/com/cornellappdev/uplift/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.datastore.preferences.preferencesDataStore
import com.cornellappdev.uplift.models.DatastoreRepository
import com.cornellappdev.uplift.ui.MainNavigationWrapper
import com.cornellappdev.uplift.ui.screens.ProfileCreationScreen
import com.cornellappdev.uplift.ui.theme.UpliftTheme
import com.cornellappdev.uplift.util.LockScreenOrientation
import com.cornellappdev.uplift.util.PREFERENCES_NAME
Expand Down
Loading

0 comments on commit 713a0be

Please # to comment.