diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebc91dab..5aa3e140 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8b0b0f9c..b304d42d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - main + - chore/v6-posthog-ios-4 jobs: analyze: @@ -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: @@ -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 diff --git a/posthog_flutter/darwin/posthog_flutter/Package.swift b/posthog_flutter/darwin/posthog_flutter/Package.swift index 5d2d9474..669b33fb 100644 --- a/posthog_flutter/darwin/posthog_flutter/Package.swift +++ b/posthog_flutter/darwin/posthog_flutter/Package.swift @@ -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(