Skip to content
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

fix rainforest and sourcemaps upload scripts #9518

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/beta-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
cache: npm
- run: npm ci
- run: npm run build
- run: bash scripts/upload-sourcemaps.sh
- run: bash applications/browser-extension/scripts/upload-sourcemaps.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SOURCEMAP_USER_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SOURCEMAP_USER_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion applications/browser-extension/scripts/upload-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ BUILD_FILENAME="${BUILD_PATH##*/}"
: "${AWS_SECRET_ACCESS_KEY?Need to set AWS_SECRET_ACCESS_KEY}"
: "${AWS_DEFAULT_REGION?Need to set AWS_DEFAULT_REGION}"

zip -r "$BUILD_FILENAME" dist -x '*.map'
zip -r "$BUILD_FILENAME" applications/browser-extension/dist -x '*.map'
aws s3 cp "$BUILD_FILENAME" "s3://pixiebrix-extension-builds/$BUILD_PATH" --no-progress
6 changes: 3 additions & 3 deletions applications/browser-extension/scripts/upload-sourcemaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ set -e

# Upload to S3 for debugging in Chrome
S3_UPLOAD_BASE_URL="s3://pixiebrix-extension-source-maps/$SOURCE_MAP_PATH"
aws s3 cp ./dist "$S3_UPLOAD_BASE_URL" --exclude '*' --include '*.js.map' --include '*.js' --recursive --no-progress
aws s3 cp ./applications/browser-extension/dist "$S3_UPLOAD_BASE_URL" --exclude '*' --include '*.js.map' --include '*.js' --recursive --no-progress

# Datadog uses release-version, not the code commit version. So get from produced manifest
# Clean-up the name because it's not clear if the cli normalized the name like the JS library does
RELEASE_VERSION=$(jq -r '.version_name | gsub("\\+"; "_") | ascii_downcase' dist/manifest.json)
RELEASE_VERSION=$(jq -r '.version_name | gsub("\\+"; "_") | ascii_downcase' applications/browser-extension/dist/manifest.json)

# Should match the path that appears in minified stack trace
# See sourceMapPublicUrl in webpack.config.mjs
Expand All @@ -32,7 +32,7 @@ echo "Uploading sourcemaps to Datadog for version [[$RELEASE_VERSION]] with mini
# Reference: https://github.com/DataDog/datadog-ci/tree/master/src/commands/sourcemaps#commands
# `release-version` must match the version in initErrorReporter.ts and performance.ts
# project-path is the prefix before src in the map: webpack:///./src/bricks/registry.ts
npx --yes @datadog/datadog-ci sourcemaps upload ./dist \
npx --yes @datadog/datadog-ci sourcemaps upload ./applications/browser-extension/dist \
--service="pixiebrix-browser-extension" \
--release-version="$RELEASE_VERSION" \
--minified-path-prefix="$MINIFIED_PATH_PREFIX" \
Expand Down
Loading