chore: sync versions
All checks were successful
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m6s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
All checks were successful
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m6s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# Project
|
# Project
|
||||||
|
IMAGE_TAG=v1.7.0
|
||||||
PROJECT_NAME=sample-website
|
PROJECT_NAME=sample-website
|
||||||
PROJECT_COLOR=#82ed20
|
PROJECT_COLOR=#82ed20
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
|
|
||||||
# Check if we are pushing a tag
|
# Check if we are pushing a tag
|
||||||
if echo "$*" | grep -q "refs/tags/v"; then
|
while read local_ref local_sha remote_ref remote_sha
|
||||||
echo "🏷️ Tag detected in push, syncing versions..."
|
do
|
||||||
pnpm sync-versions
|
if [[ "$remote_ref" == refs/tags/v* ]]; then
|
||||||
|
TAG=${remote_ref#refs/tags/}
|
||||||
|
echo "🏷️ Tag detected: $TAG, syncing versions..."
|
||||||
|
pnpm sync-versions "$TAG"
|
||||||
|
|
||||||
# Stage the changed package.json files
|
# Stage the changed files
|
||||||
git add "package.json" "packages/*/package.json" "apps/*/package.json"
|
git add package.json packages/*/package.json apps/*/package.json .env .env.example
|
||||||
|
|
||||||
# Amend the tag if it's on the current commit, but this is complex in pre-push.
|
echo "⚠️ package.json and .env files updated to match tag $TAG."
|
||||||
# Better: Just warn the user that they might need to update the tag if package.json changed.
|
echo "⚠️ Note: You might need to push again if these changes were not already in your commit/tag."
|
||||||
echo "⚠️ package.json files updated to match tag. Please ensure these changes are part of your tag/commit."
|
fi
|
||||||
fi
|
done
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sample-website",
|
"name": "sample-website",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ services:
|
|||||||
- "traefik.http.services.sample-website.loadbalancer.server.port=3000"
|
- "traefik.http.services.sample-website.loadbalancer.server.port=3000"
|
||||||
|
|
||||||
directus:
|
directus:
|
||||||
image: registry.infra.mintel.me/mintel/directus:latest
|
image: registry.infra.mintel.me/mintel/directus:${IMAGE_TAG:-latest}
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- infra
|
- infra
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"test": "pnpm -r test",
|
"test": "pnpm -r test",
|
||||||
"changeset": "changeset",
|
"changeset": "changeset",
|
||||||
"version-packages": "changeset version",
|
"version-packages": "changeset version",
|
||||||
"sync-versions": "tsx scripts/sync-versions.ts",
|
"sync-versions": "tsx scripts/sync-versions.ts --",
|
||||||
"cms:push:infra": "./scripts/sync-directus.sh push infra",
|
"cms:push:infra": "./scripts/sync-directus.sh push infra",
|
||||||
"cms:pull:infra": "./scripts/sync-directus.sh pull infra",
|
"cms:pull:infra": "./scripts/sync-directus.sh pull infra",
|
||||||
"cms:schema:snapshot": "./scripts/cms-snapshot.sh",
|
"cms:schema:snapshot": "./scripts/cms-snapshot.sh",
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"pino-pretty": "^13.1.3",
|
"pino-pretty": "^13.1.3",
|
||||||
"require-in-the-middle": "^8.0.1"
|
"require-in-the-middle": "^8.0.1"
|
||||||
},
|
},
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"next": "16.1.6",
|
"next": "16.1.6",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/cli",
|
"name": "@mintel/cli",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/cms-infra",
|
"name": "@mintel/cms-infra",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "customer-manager",
|
"name": "customer-manager",
|
||||||
"description": "Custom High-Fidelity Customer & Company Management for Directus",
|
"description": "Custom High-Fidelity Customer & Company Management for Directus",
|
||||||
"icon": "supervisor_account",
|
"icon": "supervisor_account",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"directus",
|
"directus",
|
||||||
"directus-extension",
|
"directus-extension",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/eslint-config",
|
"name": "@mintel/eslint-config",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "@mintel/extension-feedback-commander",
|
"name": "@mintel/extension-feedback-commander",
|
||||||
"description": "Custom High-Fidelity Feedback Management Extension for Directus",
|
"description": "Custom High-Fidelity Feedback Management Extension for Directus",
|
||||||
"icon": "view_kanban",
|
"icon": "view_kanban",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"directus",
|
"directus",
|
||||||
"directus-extension",
|
"directus-extension",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/gatekeeper",
|
"name": "@mintel/gatekeeper",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/husky-config",
|
"name": "@mintel/husky-config",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ services:
|
|||||||
- "traefik.http.services.${PROJECT_NAME}-gatekeeper.loadbalancer.server.port=3000"
|
- "traefik.http.services.${PROJECT_NAME}-gatekeeper.loadbalancer.server.port=3000"
|
||||||
|
|
||||||
directus:
|
directus:
|
||||||
image: registry.infra.mintel.me/mintel/directus:latest
|
image: registry.infra.mintel.me/mintel/directus:${IMAGE_TAG:-latest}
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- infra
|
- infra
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/infra",
|
"name": "@mintel/infra",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/next-feedback",
|
"name": "@mintel/next-feedback",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/next-observability",
|
"name": "@mintel/next-observability",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/next-utils",
|
"name": "@mintel/next-utils",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/observability",
|
"name": "@mintel/observability",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/tsconfig",
|
"name": "@mintel/tsconfig",
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -4,9 +4,15 @@ import * as path from "path";
|
|||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current version tag from environment or git.
|
* Gets the current version tag from arguments, environment or git.
|
||||||
*/
|
*/
|
||||||
function getVersionTag() {
|
function getVersionTag() {
|
||||||
|
// 0. Check arguments (passed from husky hook or manual run)
|
||||||
|
const argTag = process.argv.slice(2).find((arg) => arg.startsWith("v"));
|
||||||
|
if (argTag) {
|
||||||
|
return argTag;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. Check CI environment variables
|
// 1. Check CI environment variables
|
||||||
if (
|
if (
|
||||||
process.env.GITHUB_REF_NAME &&
|
process.env.GITHUB_REF_NAME &&
|
||||||
@@ -67,20 +73,50 @@ function updatePkg(pkgPath: string) {
|
|||||||
console.log(`✅ Updated ${pkg.name} to ${version}`);
|
console.log(`✅ Updated ${pkg.name} to ${version}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the IMAGE_TAG in .env files.
|
||||||
|
*/
|
||||||
|
function updateEnv(envPath: string) {
|
||||||
|
if (!fs.existsSync(envPath)) return;
|
||||||
|
let content = fs.readFileSync(envPath, "utf-8");
|
||||||
|
|
||||||
|
if (content.includes("IMAGE_TAG=")) {
|
||||||
|
content = content.replace(/IMAGE_TAG=.*/g, `IMAGE_TAG=${tag}`);
|
||||||
|
} else {
|
||||||
|
// Proactively add it if missing
|
||||||
|
if (content.includes("# Project")) {
|
||||||
|
content = content.replace("# Project", `# Project\nIMAGE_TAG=${tag}`);
|
||||||
|
} else {
|
||||||
|
content = `IMAGE_TAG=${tag}\n${content}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(envPath, content);
|
||||||
|
console.log(`✅ Updated IMAGE_TAG in ${envPath} to ${tag}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Update root
|
// Update root
|
||||||
rootPkg.version = version;
|
rootPkg.version = version;
|
||||||
fs.writeFileSync("package.json", JSON.stringify(rootPkg, null, 2) + "\n");
|
fs.writeFileSync("package.json", JSON.stringify(rootPkg, null, 2) + "\n");
|
||||||
|
|
||||||
// Update all packages
|
// Update all packages
|
||||||
const packages = fs.readdirSync(packagesDir);
|
if (fs.existsSync(packagesDir)) {
|
||||||
for (const p of packages) {
|
const packages = fs.readdirSync(packagesDir);
|
||||||
updatePkg(path.join(packagesDir, p, "package.json"));
|
for (const p of packages) {
|
||||||
|
updatePkg(path.join(packagesDir, p, "package.json"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update all apps
|
// Update all apps
|
||||||
const apps = fs.readdirSync(appsDir);
|
if (fs.existsSync(appsDir)) {
|
||||||
for (const a of apps) {
|
const apps = fs.readdirSync(appsDir);
|
||||||
updatePkg(path.join(appsDir, a, "package.json"));
|
for (const a of apps) {
|
||||||
|
updatePkg(path.join(appsDir, a, "package.json"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update .env files
|
||||||
|
updateEnv(".env");
|
||||||
|
updateEnv(".env.example");
|
||||||
|
|
||||||
console.log("✨ All versions synced!");
|
console.log("✨ All versions synced!");
|
||||||
|
|||||||
Reference in New Issue
Block a user