diff --git a/docs/platforms/android/build-distribution/index.mdx b/docs/platforms/android/build-distribution/index.mdx new file mode 100644 index 00000000000000..981e3fd3469503 --- /dev/null +++ b/docs/platforms/android/build-distribution/index.mdx @@ -0,0 +1,34 @@ +--- +title: Build Distribution +sidebar_title: Build Distribution +sidebar_order: 5250 +description: Upload Android builds to Sentry for distribution to internal teams and beta testers. +--- + + + +[Build Distribution](/product/build-distribution) helps you securely distribute Android builds to your internal teams and beta testers. + +## Getting Started + +**Accepted Formats**: AAB (preferred) | APK + +**Upload Mechanisms**: [Gradle](#uploading-with-gradle) | [Sentry CLI](#uploading-with-the-sentry-cli) + +### Uploading With Gradle + + + +### Uploading With the Sentry CLI + + + +## Upload Metadata + + + +### Build Configuration + + + + diff --git a/docs/platforms/apple/guides/ios/build-distribution/index.mdx b/docs/platforms/apple/guides/ios/build-distribution/index.mdx new file mode 100644 index 00000000000000..ef555cd7c604bc --- /dev/null +++ b/docs/platforms/apple/guides/ios/build-distribution/index.mdx @@ -0,0 +1,40 @@ +--- +title: Build Distribution +sidebar_order: 5250 +description: Upload iOS builds to Sentry for distribution to internal teams and beta testers. +--- + + + +[Build Distribution](/product/build-distribution) helps you securely distribute iOS builds to your internal teams and beta testers. +Streamline your distribution workflow with automated uploads from CI. + +## Getting Started + +**Accepted Formats**: XCArchive (preferred) | IPA + +**Upload Mechanisms**: [Fastlane Plugin](#uploading-with-fastlane) (version 1.35.0 or higher) _or_ [Sentry CLI](#uploading-with-the-sentry-cli) + +### Uploading With Fastlane + + + +### Uploading with the Sentry CLI + + + +## Upload Metadata + + + +### Build Configuration + + + +## Distribution Management + +## What's Next? + +We strongly recommend integrating Build Distribution into your CI pipeline for automated distribution workflows. + + diff --git a/docs/product/build-distribution/index.mdx b/docs/product/build-distribution/index.mdx new file mode 100644 index 00000000000000..4ab83b5cd2bc88 --- /dev/null +++ b/docs/product/build-distribution/index.mdx @@ -0,0 +1,28 @@ +--- +title: Build Distribution +sidebar_order: 137 +description: Distribute app builds to internal teams and beta testers. +--- + + + +Build Distribution enables you to securely distribute app builds to your internal teams and beta testers. Upload builds from CI to streamline your distribution workflow, manage access control, and track installation analytics. + +### CI Integration + +Integrate Build Distribution into your CI pipeline to automatically distribute builds to your teams. + +## Upload Guides + +You can follow the platform guides to learn how to upload builds for distribution: + +- [iOS](/platforms/apple/guides/ios/build-distribution/) +- [Android](/platforms/android/build-distribution/) + +### Upload Metadata + +Below is the metadata included in your build, regardless of the platform. + + + + diff --git a/includes/build-distribution/ea.mdx b/includes/build-distribution/ea.mdx new file mode 100644 index 00000000000000..82918e5ed89396 --- /dev/null +++ b/includes/build-distribution/ea.mdx @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/includes/build-distribution/upload-gradle.mdx b/includes/build-distribution/upload-gradle.mdx new file mode 100644 index 00000000000000..77a8829aaf2f74 --- /dev/null +++ b/includes/build-distribution/upload-gradle.mdx @@ -0,0 +1 @@ + diff --git a/includes/size-analysis/upload-gradle.mdx b/includes/size-analysis/upload-gradle.mdx index f4b9db01b2a3cd..36d85ea09e8c42 100644 --- a/includes/size-analysis/upload-gradle.mdx +++ b/includes/size-analysis/upload-gradle.mdx @@ -1,100 +1 @@ -The Gradle plugin automatically detects build metadata from your git repository. On GitHub Actions, all metadata is automatically detected. On other CI systems, you may need to manually set some values using the `vcsInfo` extension. - -1. Configure the [Sentry Android Gradle plugin](/platforms/android/configuration/gradle/) with at least version `6.0.0-beta1` - -2. Set the auth token as an environment variable to be used when running your release build. - - - - ```bash - export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ - ``` - -3. Enable uploading for size analysis for CI builds. - - ```kotlin {filename:build.gradle.kts} - sentry { - sizeAnalysis { - enabled = providers.environmentVariable("GITHUB_ACTIONS").isPresent - } - } - ``` - - ```groovy {filename:build.gradle} - sentry { - sizeAnalysis { - enabled = providers.environmentVariable("GITHUB_ACTIONS").present - } - } - ``` - -4. Invoke the following Gradle tasks to build your app and trigger the upload. - - ```aab {filename:aab} - ./gradlew bundleRelease - ``` - - ```apk {filename:apk} - ./gradlew assembleRelease - ``` - -5. After an upload has successfully processed, confirm the metadata is correct in the Sentry UI - - ![Upload metadata =400x](./images/android-metadata.png) - -### Overriding Metadata - -The Gradle plugin automatically detects build metadata from your git repository. On GitHub Actions, all metadata is automatically detected. On other CI systems, you may need to manually set some values using the `vcsInfo` extension. - -Configure overrides in your Gradle build configuration: - -```kotlin {filename:build.gradle.kts} -sentry { - sizeAnalysis { - enabled = providers.environmentVariable("GITHUB_ACTIONS").isPresent - } - - vcsInfo { - headSha.set("abc123") - baseSha.set("def456") - vcsProvider.set("github") - headRepoName.set("organization/repository") - baseRepoName.set("organization/repository") - headRef.set("feature-branch") - baseRef.set("main") - prNumber.set(42) - } -} -``` - -```groovy {filename:build.gradle} -sentry { - sizeAnalysis { - enabled = providers.environmentVariable("GITHUB_ACTIONS").present - } - - vcsInfo { - headSha = 'abc123' - baseSha = 'def456' - vcsProvider = 'github' - headRepoName = 'organization/repository' - baseRepoName = 'organization/repository' - headRef = 'feature-branch' - baseRef = 'main' - prNumber = 42 - } -} -``` - -Available `vcsInfo` properties: - -| Property | Type | Description | -| -------------- | ------ | --------------------------------- | -| `headSha` | String | Current commit SHA | -| `baseSha` | String | Base commit SHA (for comparison) | -| `vcsProvider` | String | VCS provider (e.g., "github") | -| `headRepoName` | String | Repository name (org/repo format) | -| `baseRepoName` | String | Base repository name | -| `headRef` | String | Branch or tag name | -| `baseRef` | String | Base branch name | -| `prNumber` | Int | Pull request number | + diff --git a/public/platforms/android/build-distribution/images/android-metadata.png b/public/platforms/android/build-distribution/images/android-metadata.png new file mode 100644 index 00000000000000..ecb49e94ad966a Binary files /dev/null and b/public/platforms/android/build-distribution/images/android-metadata.png differ diff --git a/src/components/gradleFeatureConfig.tsx b/src/components/gradleFeatureConfig.tsx new file mode 100644 index 00000000000000..4106c97ff12943 --- /dev/null +++ b/src/components/gradleFeatureConfig.tsx @@ -0,0 +1,39 @@ +import {CodeBlock} from './codeBlock'; +import {CodeTabs} from './codeTabs'; +import {codeToJsx} from './highlightCode'; + +type Props = { + feature: string; +}; + +export function GradleFeatureConfig({feature}: Props) { + return ( + + +
+          {codeToJsx(
+            `sentry {
+  ${feature} {
+    enabled = providers.environmentVariable("GITHUB_ACTIONS").isPresent
+  }
+}`,
+            'kotlin'
+          )}
+        
+
+ + +
+          {codeToJsx(
+            `sentry {
+  ${feature} {
+    enabled = providers.environmentVariable("GITHUB_ACTIONS").present
+  }
+}`,
+            'groovy'
+          )}
+        
+
+
+ ); +} diff --git a/src/components/gradleUploadInstructions.tsx b/src/components/gradleUploadInstructions.tsx new file mode 100644 index 00000000000000..d7e4bec60181f4 --- /dev/null +++ b/src/components/gradleUploadInstructions.tsx @@ -0,0 +1,211 @@ +import {Fragment} from 'react'; + +import {CodeBlock} from './codeBlock'; +import {CodeTabs} from './codeTabs'; +import {GradleFeatureConfig} from './gradleFeatureConfig'; +import {codeToJsx} from './highlightCode'; +import {OrgAuthTokenNote} from './orgAuthTokenNote'; + +type Props = { + feature: 'sizeAnalysis' | 'distribution'; +}; + +export function GradleUploadInstructions({feature}: Props) { + const featureName = feature === 'sizeAnalysis' ? 'size analysis' : 'distribution'; + + return ( + +

+ The Gradle plugin automatically detects build metadata from your git repository. + On GitHub Actions, all metadata is automatically detected. On other CI systems, + you may need to manually set some values using the vcsInfo extension. +

+ +
    +
  1. + Configure the{' '} + + Sentry Android Gradle plugin + {' '} + with at least version 6.0.0-beta1 +
  2. + +
  3. +

    + Set the auth token as an environment variable to be used when running your + release build. +

    + + +
    +              {codeToJsx(`export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___`, 'bash')}
    +            
    +
    +
  4. + +
  5. +

    Enable uploading for {featureName} for CI builds.

    + +
  6. + +
  7. +

    + Invoke the following Gradle tasks to build your app and trigger the upload. +

    + + +
    {codeToJsx(`./gradlew bundleRelease`, 'bash')}
    +
    + +
    {codeToJsx(`./gradlew assembleRelease`, 'bash')}
    +
    +
    +
  8. + +
  9. +

    + After an upload has successfully processed, confirm the metadata is correct in + the Sentry UI +

    + Upload metadata +
  10. +
+ +

Overriding Metadata

+ +

+ The Gradle plugin automatically detects build metadata from your git repository. + On GitHub Actions, all metadata is automatically detected. On other CI systems, + you may need to manually set some values using the vcsInfo extension. +

+ +

Configure overrides in your Gradle build configuration:

+ + + +
+            {codeToJsx(
+              `sentry {
+  ${feature} {
+    enabled = providers.environmentVariable("GITHUB_ACTIONS").isPresent
+  }
+
+  vcsInfo {
+    headSha.set("abc123")
+    baseSha.set("def456")
+    vcsProvider.set("github")
+    headRepoName.set("organization/repository")
+    baseRepoName.set("organization/repository")
+    headRef.set("feature-branch")
+    baseRef.set("main")
+    prNumber.set(42)
+  }
+}`,
+              'kotlin'
+            )}
+          
+
+ + +
+            {codeToJsx(
+              `sentry {
+  ${feature} {
+    enabled = providers.environmentVariable("GITHUB_ACTIONS").present
+  }
+
+  vcsInfo {
+    headSha = 'abc123'
+    baseSha = 'def456'
+    vcsProvider = 'github'
+    headRepoName = 'organization/repository'
+    baseRepoName = 'organization/repository'
+    headRef = 'feature-branch'
+    baseRef = 'main'
+    prNumber = 42
+  }
+}`,
+              'groovy'
+            )}
+          
+
+
+ +

+ Available vcsInfo properties: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
+ headSha + StringCurrent commit SHA
+ baseSha + StringBase commit SHA (for comparison)
+ vcsProvider + StringVCS provider (e.g., "github")
+ headRepoName + StringRepository name (org/repo format)
+ baseRepoName + StringBase repository name
+ headRef + StringBranch or tag name
+ baseRef + StringBase branch name
+ prNumber + IntPull request number
+
+ ); +} diff --git a/src/components/highlightCode.tsx b/src/components/highlightCode.tsx index 14e85bb8ebae9f..3b281bb924593b 100644 --- a/src/components/highlightCode.tsx +++ b/src/components/highlightCode.tsx @@ -3,16 +3,20 @@ import {jsx, jsxs} from 'react/jsx-runtime'; import {toJsxRuntime} from 'hast-util-to-jsx-runtime'; import {Nodes} from 'hastscript/lib/create-h'; import bash from 'refractor/lang/bash.js'; +import groovy from 'refractor/lang/groovy.js'; import json from 'refractor/lang/json.js'; +import kotlin from 'refractor/lang/kotlin.js'; import typescript from 'refractor/lang/typescript.js'; import {refractor} from 'refractor/lib/core.js'; refractor.register(bash); +refractor.register(groovy); refractor.register(json); +refractor.register(kotlin); refractor.register(typescript); // If a new language should be supported, add it here and register it in refractor above -export const SUPPORTED_LANGUAGES = ['bash', 'json', 'typescript']; +export const SUPPORTED_LANGUAGES = ['bash', 'groovy', 'json', 'kotlin', 'typescript']; export function codeToJsx(code: string, lang = 'json') { if (!SUPPORTED_LANGUAGES.includes(lang)) { diff --git a/src/mdxComponents.ts b/src/mdxComponents.ts index e9d31ee401f649..e75c934a936e5e 100644 --- a/src/mdxComponents.ts +++ b/src/mdxComponents.ts @@ -15,6 +15,8 @@ import {DevDocsCardGrid} from './components/devDocsCardGrid'; import DocImage from './components/docImage'; import {Expandable} from './components/expandable'; import {GitHubDomainChecker} from './components/githubDomainChecker'; +import {GradleFeatureConfig} from './components/gradleFeatureConfig'; +import {GradleUploadInstructions} from './components/gradleUploadInstructions'; import {GuideGrid} from './components/guideGrid'; import {JsBundleList} from './components/jsBundleList'; import {LambdaLayerDetail} from './components/lambdaLayerDetail'; @@ -77,6 +79,8 @@ export function mdxComponents( TableOfContents, CreateGitHubAppForm, GitHubDomainChecker, + GradleFeatureConfig, + GradleUploadInstructions, ConfigValue, DefinitionList, Expandable,