remove sentry_dart_plugin as use sentry-cli

This commit is contained in:
Dung Pham committed 2026-02-05 15:34:29 +07:00
1 parent ff897a8a9d
commit bcb3be13eb
2 files changed
+23 -13

No files matched your search

+6
View File
@@ -8,6 +8,11 @@ on:
name: Build Docker images with Sentry
permissions:
contents: read
packages: write
id-token: write
jobs:
build-dev-image-with-sentry:
name: Build development image with Sentry
@@ -186,6 +191,7 @@ jobs:
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
SENTRY_URL=${{ secrets.SENTRY_URL }}
SENTRY_RELEASE=${{ steps.app_version.outputs.version }}
GITHUB_SHA=${{ github.sha }}
VCS_REF=${{ github.repository }}@${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+17 -13
View File
@@ -14,26 +14,30 @@ WORKDIR /app
COPY . .
ENV GITHUB_SHA=$GITHUB_SHA \
SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN \
SENTRY_ORG=$SENTRY_ORG \
SENTRY_PROJECT=$SENTRY_PROJECT \
SENTRY_URL=$SENTRY_URL \
SENTRY_RELEASE=$SENTRY_RELEASE
RUN ./scripts/prebuild.sh && \
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.20.7 bash && \
sentry-cli releases new "$SENTRY_RELEASE" || true && \
flutter build web --release --source-maps --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE && \
sentry-cli sourcemaps upload build/web \
--org "$SENTRY_ORG" \
--project "$SENTRY_PROJECT" \
--auth-token "$SENTRY_AUTH_TOKEN" \
--release "$SENTRY_RELEASE" \
--dist "$GITHUB_SHA" \
--url-prefix "~/" \
--validate \
--wait && \
sentry-cli releases finalize "$SENTRY_RELEASE"
if [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_RELEASE" ]; then \
echo "Sentry configuration detected, uploading sourcemaps..." && \
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.20.7 bash && \
sentry-cli releases new "$SENTRY_RELEASE" || true && \
sentry-cli sourcemaps upload build/web \
--org "$SENTRY_ORG" \
--project "$SENTRY_PROJECT" \
--auth-token "$SENTRY_AUTH_TOKEN" \
--release "$SENTRY_RELEASE" \
--dist "$GITHUB_SHA" \
--url-prefix "~/" \
--validate \
--wait || echo "Sentry sourcemaps upload failed, continuing build" && \
sentry-cli releases finalize "$SENTRY_RELEASE" || echo "Sentry release finalize failed, continuing build"; \
else \
echo "Sentry configuration not complete, skipping sourcemap upload"; \
fi
FROM nginx:alpine
RUN apk add gzip