Skip to content

Commit

Permalink
merge CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamlangford committed Nov 13, 2024
2 parents 54cb1d2 + 8334de1 commit 35f4cfe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit 35f4cfe

Please sign in to comment.