Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,18 @@ jobs:
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
run: flutter pub get

- name: Publish unreleased posthog-android 4.0 to mavenLocal
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
run: |
git clone --depth 1 -b chore/v4-remove-deprecated https://github.com/PostHog/posthog-android.git "$RUNNER_TEMP/posthog-android"
cd "$RUNNER_TEMP/posthog-android"
sed -i 's/^coreVersion=.*/coreVersion=7.0.0/; s/^androidVersion=.*/androidVersion=4.0.0/' gradle.properties
# posthog-android requires signing when CI=true, and there is no key here.
CI=false ./gradlew :posthog:publishToMavenLocal :posthog-android:publishToMavenLocal
cd "$GITHUB_WORKSPACE"
python3 -c "p='example/android/build.gradle.kts'; s=open(p).read(); open(p,'w').write(s.replace('repositories {\n google()', 'repositories {\n mavenLocal()\n google()', 1))"
grep -n mavenLocal example/android/build.gradle.kts

- name: Build Android
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
working-directory: ./example
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- chore/v6-posthog-ios-4

jobs:
analyze:
Expand Down Expand Up @@ -71,6 +72,18 @@ jobs:
if: matrix.language == 'java-kotlin'
run: flutter pub get

- name: Publish unreleased posthog-android 4.0 to mavenLocal
if: matrix.language == 'java-kotlin'
run: |
git clone --depth 1 -b chore/v4-remove-deprecated https://github.com/PostHog/posthog-android.git "$RUNNER_TEMP/posthog-android"
cd "$RUNNER_TEMP/posthog-android"
sed -i 's/^coreVersion=.*/coreVersion=7.0.0/; s/^androidVersion=.*/androidVersion=4.0.0/' gradle.properties
# posthog-android requires signing when CI=true, and there is no key here.
CI=false ./gradlew :posthog:publishToMavenLocal :posthog-android:publishToMavenLocal
cd "$GITHUB_WORKSPACE"
python3 -c "p='example/android/build.gradle.kts'; s=open(p).read(); open(p,'w').write(s.replace('repositories {\n google()', 'repositories {\n mavenLocal()\n google()', 1))"
grep -n mavenLocal example/android/build.gradle.kts

- name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
Expand All @@ -83,6 +96,15 @@ jobs:
working-directory: ./example
run: flutter build apk

# The posthog-android publish and the apk build leave Gradle and Kotlin daemons running.
# With CodeQL's query run on top of them, the runner runs out of memory and is shut down.
- name: Stop Gradle daemons (Java/Kotlin)
if: matrix.language == 'java-kotlin'
run: |
(cd "$RUNNER_TEMP/posthog-android" && ./gradlew --stop) || true
(cd example/android && ./gradlew --stop) || true
pkill -f KotlinCompileDaemon || true

- name: Build iOS (Swift)
if: matrix.language == 'swift'
working-directory: ./example
Expand Down
2 changes: 1 addition & 1 deletion posthog_flutter/darwin/posthog_flutter/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework"),
.package(url: "https://github.com/PostHog/posthog-ios", "4.0.0" ..< "5.0.0"),
.package(url: "https://github.com/PostHog/posthog-ios", branch: "chore/v4-remove-deprecated"),
],
targets: [
.target(
Expand Down
Loading