-
Notifications
You must be signed in to change notification settings - Fork 684
Open source the Firebase build tools #7670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
464db08
Open source the Firebase build tools (#7653)
mrober e42ce4e
Add build tools to subprojects and clean up error prone failures (#7657)
mrober 651bf4c
add missing quote to README.md (#7668)
kaibolay 28edb90
Changes since the build tools source was staged on Nov 20 (#7658)
mrober 0caf9c2
Copy over build tools workflows (#7660)
mrober e352a7b
Explicitly set permissions: contents: read only (#7671)
mrober File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| name: Create release (build tools) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| product: | ||
| description: Which product to make a release of ? | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - app-distribution | ||
| - crashlytics | ||
| - performance | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| ARTIFACTS: ${{ github.workspace }}/build/artifacts | ||
|
|
||
| jobs: | ||
| make-app-distribution-release: | ||
| runs-on: ubuntu-latest | ||
| if: inputs.product == 'app-distribution' | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
| cache: gradle | ||
| - name: Make release for Firebase App Distribution | ||
| run: | | ||
| ./gradlew \ | ||
| -Dorg.gradle.project.buildDir=${ARTIFACTS} \ | ||
| -Dmaven.repo.local=${ARTIFACTS} \ | ||
| :firebase-appdistribution-gradle:publishToMavenLocal | ||
| cd ${ARTIFACTS} | ||
| zip -r m2repository.zip com | ||
| - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
| with: | ||
| name: artifacts | ||
| path: ${{ env.ARTIFACTS }} | ||
|
|
||
| make-crashlytics-release: | ||
| runs-on: ubuntu-latest | ||
| if: inputs.product == 'crashlytics' | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
| cache: gradle | ||
| - name: Make release for Firebase Crashlytics | ||
| run: | | ||
| ./gradlew \ | ||
| -Dorg.gradle.project.buildDir=${ARTIFACTS} \ | ||
| -Dmaven.repo.local=${ARTIFACTS} \ | ||
| :firebase-crashlytics-buildtools:publishToMavenLocal | ||
| ./gradlew \ | ||
| -Dorg.gradle.project.buildDir=${ARTIFACTS} \ | ||
| -Dmaven.repo.local=${ARTIFACTS} \ | ||
| :firebase-crashlytics-gradle:publishToMavenLocal | ||
| cd ${ARTIFACTS} | ||
| zip -r m2repository.zip com | ||
| - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
| with: | ||
| name: artifacts | ||
| path: ${{ env.ARTIFACTS }} | ||
|
|
||
| make-performance-release: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| if: inputs.product == 'performance' | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
| cache: gradle | ||
| - name: Make release for Firebase Performance | ||
| run: | | ||
| ./gradlew \ | ||
| -Dorg.gradle.project.buildDir=${ARTIFACTS} \ | ||
| -Dmaven.repo.local=${ARTIFACTS} \ | ||
| :firebase-perf-gradle:publishToMavenLocal | ||
| cd ${ARTIFACTS} | ||
| zip -r m2repository.zip com | ||
| - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
| with: | ||
| name: artifacts | ||
| path: ${{ env.ARTIFACTS }} | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Perf Gradle Compatibility Tests | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 6 * * *' # Run daily at 6 AM | ||
| workflow_dispatch: # Allow manual triggering | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| performance-plugin: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
| cache: gradle | ||
| - name: Run tests | ||
| id: tests | ||
| run: | | ||
| ./gradlew \ | ||
| :firebase-perf-gradle:test --tests \ | ||
| "com.google.firebase.perf.plugin.transform.InstrumentationApiCompatTest.gradleBuildRunsInstrumentationForAllVariants_latestGradleAndAgp" | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### App Distribution Gradle plugin version 5.2.1 | ||
|
|
||
| * {{fixed}} Declare dependency on GoogleServices plugin | ||
|
|
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # App Distribution Gradle Plugin | ||
|
|
||
| This directory contains the source code for the | ||
| [Firebase App Distribution Gradle Plugin](https://firebase.google.com/docs/app-distribution/android/distribute-gradle), | ||
| which allows uploading distributions, enabling access for testers, and adding release notes. | ||
|
|
||
| --- | ||
|
|
||
| ## appdistribution-gradle | ||
|
|
||
| This subproject produces a Gradle Plugin which faciliates the use cases of | ||
| appdistribution-buildtools for Android apps built with Gradle. | ||
|
|
||
| #### Build / Install | ||
|
|
||
| `./gradlew :firebase-appdistribution-gradle:publishToMavenLocal` | ||
|
|
||
| The produced local Maven artifact is "com.google.firebase:firebase-appdistribution-gradle". | ||
|
|
||
| #### Test | ||
|
|
||
| To run unit tests, run: | ||
|
|
||
| `./gradlew :firebase-appdistribution-gradle:test` | ||
|
|
||
| To run integration tests, run: | ||
|
|
||
| `./gradlew :firebase-appdistribution-gradle:integrationTest` | ||
|
|
||
| To test manually, add the plugin to your Android project | ||
|
|
||
| `apply plugin: 'com.google.firebase.appdistribution'` | ||
|
|
||
| ## Release Process | ||
|
|
||
| 1. Create a PR with the changes, and request a review to submit it to `main`. Add the changes in the | ||
| `CHANGELOG.md`. | ||
| 2. Once the changes have been submitted to `main` they will be released along with the next Android | ||
| SDK release. | ||
|
|
||
| ### Building the Maven artifact | ||
|
|
||
| Make sure to bump the [version of the plugin](gradle.properties#L3). | ||
|
|
||
| Use the | ||
| ["Make Releases" GitHub Actions workflow](https://github.com/firebase/firebase-android-buildtools/actions/workflows/make-releases.yml) | ||
| ([source](../.github/workflows/make-releases.yml)) to produce maven artifacts. Please refer to the | ||
| [GitHub Actions documentation](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) | ||
| on how to trigger the workflow manually. The `m2repository.zip` can be downloaded from the | ||
| "Artifacts" section on the workflow execution page. | ||
|
|
||
| ### Testing the artifact (optional) | ||
|
|
||
| Download the `m2repository.zip` artifact from GCS. Extract the contents of the zip file to a local | ||
| directory. In the project-level Gradle file of a test app add the path to the local maven | ||
| repository to the `repositories` block and | ||
| `classpath 'com.google.firebase:firebase-appdistribution-gradle:x.y.z'` | ||
| to the dependencies block. | ||
|
|
||
| ``` | ||
| repositories { | ||
| // ... | ||
|
|
||
| // Add path to gradle plugin local maven repository | ||
| maven { | ||
| url 'file://<path_to_gradle_plugin_maven_repo>' | ||
| } | ||
| } | ||
| dependencies { | ||
| // ... | ||
|
|
||
| // Add the pre version of the Gradle plugin | ||
| classpath 'com.google.firebase:firebase-appdistribution-gradle:x.y.z' | ||
| } | ||
| ``` | ||
|
|
||
| Sync your project and validate by running an app distribution gradle | ||
| command such as: | ||
|
|
||
| ``` | ||
| ./gradlew assembleDebug appDistributionUploadDebug | ||
| ``` | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.