minVersion: '0.23.1'
changelogPolicy: simple
preReleaseCommand: bash scripts/craft-pre-release.sh
targets:
  # NPM Targets
  ## 1. Base Packages, node or browser SDKs depend on
  ## 1.1 Types
  - name: npm
    id: '@sentry/types'
    includeNames: /^sentry-types-\d.*\.tgz$/
  ## 1.2 Utils
  - name: npm
    id: '@sentry/utils'
    includeNames: /^sentry-utils-\d.*\.tgz$/
  ## 1.3 Core SDK
  - name: npm
    id: '@sentry/core'
    includeNames: /^sentry-core-\d.*\.tgz$/
  ## 1.4 Tracing package
  - name: npm
    id: '@sentry-internal/tracing'
    includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
  ## 1.5 Replay package (browser only)
  - name: npm
    id: '@sentry/replay'
    includeNames: /^sentry-replay-\d.*\.tgz$/
  ## 1.6. OpenTelemetry package
  - name: npm
    id: '@sentry/opentelemetry'
    includeNames: /^sentry-opentelemetry-\d.*\.tgz$/

  ## 2. Browser & Node SDKs
  - name: npm
    id: '@sentry/browser'
    includeNames: /^sentry-browser-\d.*\.tgz$/
  - name: npm
    id: '@sentry/node'
    includeNames: /^sentry-node-\d.*\.tgz$/

  ## 3 Browser-based Packages
  - name: npm
    id: '@sentry/angular-ivy'
    includeNames: /^sentry-angular-ivy-\d.*\.tgz$/
  - name: npm
    id: '@sentry/angular'
    includeNames: /^sentry-angular-\d.*\.tgz$/
  - name: npm
    id: '@sentry/ember'
    includeNames: /^sentry-ember-\d.*\.tgz$/
  - name: npm
    id: '@sentry/react'
    includeNames: /^sentry-react-\d.*\.tgz$/
  - name: npm
    id: '@sentry/svelte'
    includeNames: /^sentry-svelte-\d.*\.tgz$/
  - name: npm
    id: '@sentry/vue'
    includeNames: /^sentry-vue-\d.*\.tgz$/
  - name: npm
    id: '@sentry/wasm'
    includeNames: /^sentry-wasm-\d.*\.tgz$/
  - name: npm
    id: '@sentry/integrations'
    includeNames: /^sentry-integrations-\d.*\.tgz$/

  ## 4. WinterCG Packages
  - name: npm
    id: '@sentry/vercel-edge'
    includeNames: /^sentry-vercel-edge-\d.*\.tgz$/
  - name: npm
    id: '@sentry/deno'
    includeNames: /^sentry-deno-\d.*\.tgz$/
  - name: commit-on-git-repository
    # This will publish on the Deno registry
    id: getsentry/deno
    archive: /^sentry-deno-\d.*\.tgz$/
    repositoryUrl: https://github.com/getsentry/sentry-deno.git
    stripComponents: 1
    branch: main
    createTag: true

  ## 5. Node-based Packages
  - name: npm
    id: '@sentry/serverless'
    includeNames: /^sentry-serverless-\d.*\.tgz$/
  - name: npm
    id: '@sentry/opentelemetry-node'
    includeNames: /^sentry-opentelemetry-node-\d.*\.tgz$/
  - name: npm
    id: '@sentry/bun'
    includeNames: /^sentry-bun-\d.*\.tgz$/

  ## 6. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
  - name: npm
    id: '@sentry/nextjs'
    includeNames: /^sentry-nextjs-\d.*\.tgz$/
  - name: npm
    id: '@sentry/remix'
    includeNames: /^sentry-remix-\d.*\.tgz$/
  - name: npm
    id: '@sentry/sveltekit'
    includeNames: /^sentry-sveltekit-\d.*\.tgz$/
  - name: npm
    id: '@sentry/gatsby'
    includeNames: /^sentry-gatsby-\d.*\.tgz$/
  - name: npm
    id: '@sentry/astro'
    includeNames: /^sentry-astro-\d.*\.tgz$/

  ## 7. Other Packages
  ## 7.1
  - name: npm
    id: '@sentry-internal/typescript'
    includeNames: /^sentry-internal-typescript-\d.*\.tgz$/
  - name: npm
    id: '@sentry-internal/eslint-plugin-sdk'
    includeNames: /^sentry-internal-eslint-plugin-sdk-\d.*\.tgz$/
  ## 7.2
  - name: npm
    id: '@sentry-internal/eslint-config-sdk'
    includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/

  ## 8. Deprecated packages we still release (but no packages depend on them anymore)
  - name: npm
    id: '@sentry/hub'
    includeNames: /^sentry-hub-\d.*\.tgz$/
  - name: npm
    id: '@sentry/tracing'
    includeNames: /^sentry-tracing-\d.*\.tgz$/

  ## 9. Experimental packages
  - name: npm
    id: '@sentry/node-experimental'
    includeNames: /^sentry-node-experimental-\d.*\.tgz$/

  # AWS Lambda Layer target
  - name: aws-lambda-layer
    includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha)\.\d+)?\.zip$/
    layerName: SentryNodeServerlessSDK
    compatibleRuntimes:
      - name: node
        versions:
          - nodejs10.x
          - nodejs12.x
          - nodejs14.x
          - nodejs16.x
          - nodejs18.x
    license: MIT

  # CDN Bundle Target
  - name: gcs
    id: 'browser-cdn-bundles'
    includeNames: /.*\.js.*$/
    bucket: sentry-js-sdk
    paths:
      - path: /{{version}}/
        metadata:
          cacheControl: 'public, max-age=31536000'

  # Github Release Target
  - name: github
    includeNames: /^sentry-.*$/

  # Sentry Release Registry Target
  - name: registry
    sdks:
      'npm:@sentry/browser':
        onlyIfPresent: /^sentry-browser-\d.*\.tgz$/
        includeNames: /\.js$/
        checksums:
          - algorithm: sha384
            format: base64
      'npm:@sentry/node':
        onlyIfPresent: /^sentry-node-\d.*\.tgz$/
      'npm:@sentry/react':
        onlyIfPresent: /^sentry-react-\d.*\.tgz$/
      'npm:@sentry/vue':
        onlyIfPresent: /^sentry-vue-\d.*\.tgz$/
      'npm:@sentry/gatsby':
        onlyIfPresent: /^sentry-gatsby-\d.*\.tgz$/
      'npm:@sentry/angular-ivy':
        onlyIfPresent: /^sentry-angular-ivy-\d.*\.tgz$/
      'npm:@sentry/angular':
        onlyIfPresent: /^sentry-angular-\d.*\.tgz$/
      'npm:@sentry/astro':
        onlyIfPresent: /^sentry-astro-\d.*\.tgz$/
      'npm:@sentry/wasm':
        onlyIfPresent: /^sentry-wasm-\d.*\.tgz$/
      'npm:@sentry/nextjs':
        onlyIfPresent: /^sentry-nextjs-\d.*\.tgz$/
      'npm:@sentry/remix':
        onlyIfPresent: /^sentry-remix-\d.*\.tgz$/
      'npm:@sentry/svelte':
        onlyIfPresent: /^sentry-svelte-\d.*\.tgz$/
      'npm:@sentry/sveltekit':
        onlyIfPresent: /^sentry-sveltekit-\d.*\.tgz$/
      'npm:@sentry/opentelemetry-node':
        onlyIfPresent: /^sentry-opentelemetry-node-\d.*\.tgz$/
      'npm:@sentry/bun':
        onlyIfPresent: /^sentry-bun-\d.*\.tgz$/
      'npm:@sentry/vercel-edge':
        onlyIfPresent: /^sentry-vercel-edge-\d.*\.tgz$/
      'npm:@sentry/ember':
        onlyIfPresent: /^sentry-ember-\d.*\.tgz$/
