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

Conditional changelog builds #11770

Merged
merged 23 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
3 changes: 3 additions & 0 deletions apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"lint": "next lint",
"migrate:dev": "dotenv -e .env.development -- yarn prisma migrate reset"
},
"prisma": {
"seed": "node prisma/seed/seed.mjs"
},
"dependencies": {
"@auth/prisma-adapter": "^1.2.0",
"@google-cloud/storage": "^7.7.0",
Expand Down
1 change: 1 addition & 0 deletions apps/changelog/prisma/seed/seed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ async function seed() {
console.log('Seed data created successfully!');
} catch (error) {
console.error('Error seeding data:', error);
process.exit(1);
} finally {
await prisma.$disconnect();
}
Expand Down
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"dev": "yarn enforce-redirects && concurrently \"yarn sidecar\" \"node ./src/hotReloadWatcher.mjs\" \"next dev\"",
"dev:developer-docs": "yarn enforce-redirects && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn dev",
"build:developer-docs": "yarn enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn build",
"build": "yarn enforce-redirects && prisma generate && next build",
"build": "yarn enforce-redirects && next build",
"vercel:build:developer-docs": "yarn enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn build",
"start": "next start",
"migrate:dev": "dotenv -e .env.development -- yarn prisma migrate reset",
"lint": "next lint",
"lint:ts": "tsc --skipLibCheck",
"lint:docs": "bin/lint-docs.ts",
Expand All @@ -35,12 +34,8 @@
"test:ci": "vitest run",
"enforce-redirects": "node ./scripts/no-vercel-json-redirects.mjs"
},
"prisma": {
"seed": "node prisma/seed/seed.mjs"
},
"dependencies": {
"@ariakit/react": "^0.4.5",
"@auth/prisma-adapter": "^1.2.0",
"@emotion/core": "^11.0.0",
"@emotion/react": "^11.11.0",
"@emotion/styled": "^11.0.0",
Expand All @@ -50,7 +45,6 @@
"@next/mdx": "^14.2.4",
"@popperjs/core": "^2.11.8",
"@prettier/plugin-xml": "^3.3.1",
"@prisma/client": "^5.8.1",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dropdown-menu": "^2.0.6",
Expand Down Expand Up @@ -126,7 +120,6 @@
"jest-environment-jsdom": "^29.5.0",
"postcss": "^8.4.33",
"prettier": "^3.2.4",
"prisma": "^5.8.1",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.1",
"typescript": "^5",
Expand Down
11 changes: 11 additions & 0 deletions skip-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ docs_diff_status=$(git diff HEAD^ HEAD --quiet -- docs includes platform-include
# have changes occurred outside of the content directories
non_content_diff_status=$(git diff HEAD^ HEAD --name-only | grep -vE '^(docs/|platform-includes/|includes/|develop-docs/)' | wc -l)

# apps/changelog changes or workspace deps changes (yarn.lock)
changelog_diff_status=$(git diff HEAD^ HEAD --name-only | grep -E '^(apps/changelog/|yarn.lock)' | wc -l)

if [[ "$NEXT_PUBLIC_CHANGELOG" == "1" ]] ; then
if [[ $changelog_diff_status -gt 0 ]] ; then
exit 1
else
exit 0
fi
fi

# always build on changes in non-content related directories
if [[ $non_content_diff_status -gt 0 ]] ; then
exit 1
Expand Down
Loading