Skip to content

Commit

Permalink
Merge branch 'main' into mth-no-subway-schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
boringcactus committed Mar 26, 2024
2 parents 5957384 + 4dd47f3 commit e053a35
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 42 deletions.
73 changes: 49 additions & 24 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ jobs:
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
android:
name: Analyze, test, build, and ${{ github.event_name == 'pull_request' && 'validate on' || 'upload to' }} Google Play
test-android:
name: Test for Android
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Read asdf versions
Expand All @@ -61,20 +59,6 @@ jobs:
VERSION=(`echo ${{steps.asdf.outputs.java}} | cut -d - -f2`)
echo "java-distribution=$DISTRIBUTION" >> "$GITHUB_OUTPUT"
echo "java-version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Configure AWS Credentials
if: github.actor != 'dependabot[bot]'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Configure GCP Credentials
if: github.actor != 'dependabot[bot]'
uses: google-github-actions/auth@v2
with:
create_credentials_file: true
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up Java
uses: actions/setup-java@v4
with:
Expand All @@ -101,28 +85,69 @@ jobs:
with:
name: android-android-reports
path: androidApp/build/reports

deploy-android:
name: ${{ github.event_name == 'pull_request' && 'Validate on' || 'Upload to' }} Google Play
if: github.actor != 'dependabot[bot]'
needs:
- test-android
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
concurrency:
group: deploy-android
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Read asdf versions
id: asdf
run: cat .tool-versions | sed 's/ /=/' | tee -a "$GITHUB_OUTPUT"
- name: Parse java version
id: java-spec
run: |
DISTRIBUTION=(`echo ${{steps.asdf.outputs.java}} | cut -d - -f1`)
VERSION=(`echo ${{steps.asdf.outputs.java}} | cut -d - -f2`)
echo "java-distribution=$DISTRIBUTION" >> "$GITHUB_OUTPUT"
echo "java-version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Configure GCP Credentials
uses: google-github-actions/auth@v2
with:
create_credentials_file: true
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: ${{steps.java-spec.outputs.java-distribution}}
java-version: ${{steps.java-spec.outputs.java-version}}
cache: gradle
- uses: actions/cache@v4
with:
path: ~/.konan
key: konan-${{ runner.os }}-${{ hashFiles('build.gradle.kts') }}
restore-keys: konan-${{ runner.os }}
- name: Fetch AWS secrets
if: github.actor != 'dependabot[bot]'
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
mobile-app-android-upload-key-passphrase
- name: Load code signing key
if: github.actor != 'dependabot[bot]'
run: |
cd androidApp
aws secretsmanager get-secret-value --secret-id mobile-app-android-upload-key --output json | jq -r '.SecretBinary' | base64 --decode > upload-keystore.jks
- name: Set up Ruby
if: github.actor != 'dependabot[bot]'
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Patch Fastlane to pick up application default credentials
if: github.actor != 'dependabot[bot]'
run: bin/patch-fastlane.sh
- name: Build and ${{ github.event_name == 'pull_request' && 'validate on' || 'upload to' }} Google Play
if: github.actor != 'dependabot[bot]'
env:
KEYSTORE_FILE: "${{ github.workspace }}/androidApp/upload-keystore.jks"
KEYSTORE_PASSWORD: ${{ env.MOBILE_APP_ANDROID_UPLOAD_KEY_PASSPHRASE }}
Expand Down
1 change: 1 addition & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ android {

dependencies {
implementation(projects.shared)
implementation(platform(libs.compose.bom))
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.compose.material3)
Expand Down
38 changes: 20 additions & 18 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
[versions]
agp = "8.2.2"
kotlin = "1.9.23"
compose = "1.5.3"
compose-compiler = "1.5.11-dev-k1.9.23-96ef9dc6af1"
compose-material3 = "1.1.2"
# see https://developer.android.com/develop/ui/compose/bom/bom-mapping
# and https://developer.android.com/jetpack/androidx/releases/compose for release notes
compose-bom = "2023.10.00"
compose-compiler = "1.5.11"
androidx-activityCompose = "1.8.2"
kotlinxCoroutinesCore = "1.8.0"
kotlinxDatetime = "0.4.0"
ktorClientCore = "2.3.9"
kotlinxDatetime = "0.5.0"
ktor = "2.3.9"
sentry = "0.5.0"
skie = "0.6.2"
spatialk = "0.3.0"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
compose-foundation = { module = "androidx.compose.foundation:foundation" }
compose-material3 = { module = "androidx.compose.material3:material3" }
compose-ui = { module = "androidx.compose.ui:ui" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktorClientCore" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorClientCore" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktorClientCore" }
ktor-client-encoding = { module = "io.ktor:ktor-client-encoding", version.ref = "ktorClientCore" }
ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktorClientCore" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktorClientCore" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktorClientCore" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorClientCore" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-encoding = { module = "io.ktor:ktor-client-encoding", version.ref = "ktor" }
ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
sentry = { module = "io.sentry:sentry-kotlin-multiplatform", version.ref = "sentry" }
skie-configuration-annotations = { module = "co.touchlab.skie:configuration-annotations", version.ref = "skie" }
spatialk-geojson = { module = "io.github.dellisd.spatialk:geojson", version.ref = "spatialk" }
Expand Down

0 comments on commit e053a35

Please sign in to comment.