Skip to content

Commit f9a5ab3

Browse files
authored
Move API SHA bump to its own script (#5151)
We are now updating the API docs SHA much more frequently than monthly, so let's decouple it from the monthly Craft version bump (coupled, it was causing friction).
1 parent 190b753 commit f9a5ab3

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

scripts/bump-api-schema-sha.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# This script is part of the API docs build process:
4+
#
5+
# https://develop.sentry.dev/api/public/#build-process
6+
7+
set -eu
8+
9+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
10+
cd $SCRIPT_DIR/..
11+
12+
SENTRY_API_SCHEMA_SHA="$(curl -sSL 'https://api.github.com/repos/getsentry/sentry-api-schema/commits/main' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')"
13+
sed -i -e 's|^const SENTRY_API_SCHEMA_SHA =.*$|const SENTRY_API_SCHEMA_SHA = "'$SENTRY_API_SCHEMA_SHA'"|g' src/gatsby/utils/resolveOpenAPI.ts

scripts/bump-version.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/bash
2+
3+
# This script is part of the monthly CalVer release:
4+
#
5+
# https://github.com/getsentry/sentry-docs/blob/master/.github/workflows/release.yml#L24
6+
# https://github.com/getsentry/action-prepare-release/blob/main/action.yml
7+
# https://github.com/getsentry/craft#pre-release-command
8+
29
set -eu
310

411
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
512
cd $SCRIPT_DIR/..
6-
SENTRY_API_SCHEMA_SHA="$(curl -sSL 'https://api.github.com/repos/getsentry/sentry-api-schema/commits/main' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')"
713

8-
# These commands won't work on our machines since they're running macosx
9-
if [ "${1:-prod}" == "prod" ]; then
10-
sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE
11-
sed -i -e 's|^const SENTRY_API_SCHEMA_SHA =.*$|const SENTRY_API_SCHEMA_SHA = "'$SENTRY_API_SCHEMA_SHA'"|g' src/gatsby/utils/resolveOpenAPI.ts
12-
fi
14+
sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE

0 commit comments

Comments
 (0)