chore(packages): align platform package dirs
This commit is contained in:
@@ -122,7 +122,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.validate.outputs.version }}
|
VERSION: ${{ steps.validate.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
cd packages/${{ matrix.platform }}
|
cd "packages/oh-my-opencode-${{ matrix.platform }}"
|
||||||
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
||||||
|
|
||||||
- name: Set root package version
|
- name: Set root package version
|
||||||
@@ -188,6 +188,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
command: |
|
command: |
|
||||||
PLATFORM="${{ matrix.platform }}"
|
PLATFORM="${{ matrix.platform }}"
|
||||||
|
PACKAGE_DIR="packages/oh-my-opencode-${PLATFORM}"
|
||||||
case "$PLATFORM" in
|
case "$PLATFORM" in
|
||||||
darwin-arm64) TARGET="bun-darwin-arm64" ;;
|
darwin-arm64) TARGET="bun-darwin-arm64" ;;
|
||||||
darwin-x64) TARGET="bun-darwin-x64" ;;
|
darwin-x64) TARGET="bun-darwin-x64" ;;
|
||||||
@@ -203,9 +204,9 @@ jobs:
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$PLATFORM" == windows-* ]]; then
|
if [[ "$PLATFORM" == windows-* ]]; then
|
||||||
OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe"
|
OUTPUT="${PACKAGE_DIR}/bin/oh-my-opencode.exe"
|
||||||
else
|
else
|
||||||
OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode"
|
OUTPUT="${PACKAGE_DIR}/bin/oh-my-opencode"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT
|
bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT
|
||||||
@@ -216,7 +217,7 @@ jobs:
|
|||||||
- name: Ad-hoc sign darwin binary
|
- name: Ad-hoc sign darwin binary
|
||||||
if: steps.check.outputs.skip != 'true' && startsWith(matrix.platform, 'darwin-')
|
if: steps.check.outputs.skip != 'true' && startsWith(matrix.platform, 'darwin-')
|
||||||
run: |
|
run: |
|
||||||
BINARY="packages/${{ matrix.platform }}/bin/oh-my-opencode"
|
BINARY="packages/oh-my-opencode-${{ matrix.platform }}/bin/oh-my-opencode"
|
||||||
echo "Initial state:"
|
echo "Initial state:"
|
||||||
codesign -dvvv "$BINARY" 2>&1 || true
|
codesign -dvvv "$BINARY" 2>&1 || true
|
||||||
echo "Removing any existing signature:"
|
echo "Removing any existing signature:"
|
||||||
@@ -231,7 +232,8 @@ jobs:
|
|||||||
if: steps.check.outputs.skip != 'true'
|
if: steps.check.outputs.skip != 'true'
|
||||||
run: |
|
run: |
|
||||||
PLATFORM="${{ matrix.platform }}"
|
PLATFORM="${{ matrix.platform }}"
|
||||||
cd packages/${PLATFORM}
|
PACKAGE_DIR="packages/oh-my-opencode-${PLATFORM}"
|
||||||
|
cd "$PACKAGE_DIR"
|
||||||
|
|
||||||
if [[ "$PLATFORM" == windows-* ]]; then
|
if [[ "$PLATFORM" == windows-* ]]; then
|
||||||
# Windows: use 7z (pre-installed on windows-latest)
|
# Windows: use 7z (pre-installed on windows-latest)
|
||||||
@@ -330,17 +332,18 @@ jobs:
|
|||||||
if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success'
|
if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success'
|
||||||
run: |
|
run: |
|
||||||
PLATFORM="${{ matrix.platform }}"
|
PLATFORM="${{ matrix.platform }}"
|
||||||
mkdir -p packages/${PLATFORM}
|
PACKAGE_DIR="packages/oh-my-opencode-${PLATFORM}"
|
||||||
|
mkdir -p "$PACKAGE_DIR"
|
||||||
|
|
||||||
if [[ "$PLATFORM" == windows-* ]]; then
|
if [[ "$PLATFORM" == windows-* ]]; then
|
||||||
unzip binary-${PLATFORM}.zip -d packages/${PLATFORM}/
|
unzip binary-${PLATFORM}.zip -d "$PACKAGE_DIR/"
|
||||||
else
|
else
|
||||||
tar -xzvf binary-${PLATFORM}.tar.gz -C packages/${PLATFORM}/
|
tar -xzvf binary-${PLATFORM}.tar.gz -C "$PACKAGE_DIR/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Extracted contents:"
|
echo "Extracted contents:"
|
||||||
ls -la packages/${PLATFORM}/
|
ls -la "$PACKAGE_DIR/"
|
||||||
ls -la packages/${PLATFORM}/bin/
|
ls -la "$PACKAGE_DIR/bin/"
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success'
|
if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success'
|
||||||
@@ -369,7 +372,7 @@ jobs:
|
|||||||
DIST_TAG: ${{ steps.validate.outputs.dist_tag }}
|
DIST_TAG: ${{ steps.validate.outputs.dist_tag }}
|
||||||
NPM_CONFIG_PROVENANCE: true
|
NPM_CONFIG_PROVENANCE: true
|
||||||
run: |
|
run: |
|
||||||
cd packages/${{ matrix.platform }}
|
cd "packages/oh-my-opencode-${{ matrix.platform }}"
|
||||||
|
|
||||||
if [ -n "$DIST_TAG" ]; then
|
if [ -n "$DIST_TAG" ]; then
|
||||||
npm publish --access public --provenance --tag "$DIST_TAG" --loglevel verbose
|
npm publish --access public --provenance --tag "$DIST_TAG" --loglevel verbose
|
||||||
@@ -384,7 +387,7 @@ jobs:
|
|||||||
DIST_TAG: ${{ steps.validate.outputs.dist_tag }}
|
DIST_TAG: ${{ steps.validate.outputs.dist_tag }}
|
||||||
NPM_CONFIG_PROVENANCE: true
|
NPM_CONFIG_PROVENANCE: true
|
||||||
run: |
|
run: |
|
||||||
cd packages/${{ matrix.platform }}
|
cd "packages/oh-my-opencode-${{ matrix.platform }}"
|
||||||
|
|
||||||
# Rename package for oh-my-openagent
|
# Rename package for oh-my-openagent
|
||||||
jq --arg name "oh-my-openagent-${{ matrix.platform }}" \
|
jq --arg name "oh-my-openagent-${{ matrix.platform }}" \
|
||||||
|
|||||||
@@ -222,8 +222,9 @@ jobs:
|
|||||||
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
||||||
|
|
||||||
for platform in darwin-arm64 darwin-x64 darwin-x64-baseline linux-x64 linux-x64-baseline linux-arm64 linux-x64-musl linux-x64-musl-baseline linux-arm64-musl windows-x64 windows-x64-baseline; do
|
for platform in darwin-arm64 darwin-x64 darwin-x64-baseline linux-x64 linux-x64-baseline linux-arm64 linux-x64-musl linux-x64-musl-baseline linux-arm64-musl windows-x64 windows-x64-baseline; do
|
||||||
jq --arg v "$VERSION" '.version = $v' "packages/${platform}/package.json" > tmp.json
|
package_dir="packages/oh-my-opencode-${platform}"
|
||||||
mv tmp.json "packages/${platform}/package.json"
|
jq --arg v "$VERSION" '.version = $v' "${package_dir}/package.json" > tmp.json
|
||||||
|
mv tmp.json "${package_dir}/package.json"
|
||||||
done
|
done
|
||||||
|
|
||||||
jq --arg v "$VERSION" '.optionalDependencies = (.optionalDependencies | to_entries | map(.value = $v) | from_entries)' package.json > tmp.json && mv tmp.json package.json
|
jq --arg v "$VERSION" '.optionalDependencies = (.optionalDependencies | to_entries | map(.value = $v) | from_entries)' package.json > tmp.json && mv tmp.json package.json
|
||||||
@@ -344,8 +345,9 @@ jobs:
|
|||||||
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
||||||
|
|
||||||
for platform in darwin-arm64 darwin-x64 darwin-x64-baseline linux-x64 linux-x64-baseline linux-arm64 linux-x64-musl linux-x64-musl-baseline linux-arm64-musl windows-x64 windows-x64-baseline; do
|
for platform in darwin-arm64 darwin-x64 darwin-x64-baseline linux-x64 linux-x64-baseline linux-arm64 linux-x64-musl linux-x64-musl-baseline linux-arm64-musl windows-x64 windows-x64-baseline; do
|
||||||
jq --arg v "$VERSION" '.version = $v' "packages/${platform}/package.json" > tmp.json
|
package_dir="packages/oh-my-opencode-${platform}"
|
||||||
mv tmp.json "packages/${platform}/package.json"
|
jq --arg v "$VERSION" '.version = $v' "${package_dir}/package.json" > tmp.json
|
||||||
|
mv tmp.json "${package_dir}/package.json"
|
||||||
done
|
done
|
||||||
|
|
||||||
jq --arg v "$VERSION" '.optionalDependencies = (.optionalDependencies | to_entries | map(.value = $v) | from_entries)' package.json > tmp.json && mv tmp.json package.json
|
jq --arg v "$VERSION" '.optionalDependencies = (.optionalDependencies | to_entries | map(.value = $v) | from_entries)' package.json > tmp.json && mv tmp.json package.json
|
||||||
@@ -356,7 +358,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git add package.json packages/*/package.json
|
git add package.json packages/oh-my-opencode-*/package.json
|
||||||
git diff --cached --quiet || git commit -m "release: v${VERSION}"
|
git diff --cached --quiet || git commit -m "release: v${VERSION}"
|
||||||
|
|
||||||
- name: Create release tag
|
- name: Create release tag
|
||||||
|
|||||||
@@ -32,26 +32,27 @@ describe("build-binaries", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has correct directory names for baseline platforms", async () => {
|
it("uses exact package names as platform package directories", async () => {
|
||||||
// given
|
// given
|
||||||
const module = await import("./build-binaries.ts");
|
const module = await import("./build-binaries.ts");
|
||||||
const platforms = (module as { PLATFORMS: { dir: string; target: string }[] }).PLATFORMS;
|
const platforms = (module as { PLATFORMS: { packageName: string; packageDir: string }[] }).PLATFORMS;
|
||||||
|
|
||||||
// when
|
// when
|
||||||
const baselinePlatforms = platforms.filter((p) => p.target.includes("baseline"));
|
const packageNames = platforms.map((p) => p.packageName);
|
||||||
|
const packageDirs = platforms.map((p) => p.packageDir);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(baselinePlatforms.length).toBe(4);
|
expect(packageDirs).toEqual(packageNames);
|
||||||
expect(baselinePlatforms.map((p) => p.dir)).toContain("linux-x64-baseline");
|
expect(packageDirs).toContain("oh-my-opencode-linux-x64-baseline");
|
||||||
expect(baselinePlatforms.map((p) => p.dir)).toContain("linux-x64-musl-baseline");
|
expect(packageDirs).toContain("oh-my-opencode-linux-x64-musl-baseline");
|
||||||
expect(baselinePlatforms.map((p) => p.dir)).toContain("darwin-x64-baseline");
|
expect(packageDirs).toContain("oh-my-opencode-darwin-x64-baseline");
|
||||||
expect(baselinePlatforms.map((p) => p.dir)).toContain("windows-x64-baseline");
|
expect(packageDirs).toContain("oh-my-opencode-windows-x64-baseline");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has correct binary names for baseline platforms", async () => {
|
it("has correct binary names for baseline platforms", async () => {
|
||||||
// given
|
// given
|
||||||
const module = await import("./build-binaries.ts");
|
const module = await import("./build-binaries.ts");
|
||||||
const platforms = (module as { PLATFORMS: { dir: string; target: string; binary: string }[] }).PLATFORMS;
|
const platforms = (module as { PLATFORMS: { packageDir: string; target: string; binary: string }[] }).PLATFORMS;
|
||||||
|
|
||||||
// when
|
// when
|
||||||
const windowsBaseline = platforms.find((p) => p.target === "bun-windows-x64-baseline");
|
const windowsBaseline = platforms.find((p) => p.target === "bun-windows-x64-baseline");
|
||||||
|
|||||||
+15
-13
@@ -7,30 +7,32 @@ import { existsSync } from "node:fs";
|
|||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
|
||||||
interface PlatformTarget {
|
interface PlatformTarget {
|
||||||
dir: string;
|
platform: string;
|
||||||
|
packageName: string;
|
||||||
|
packageDir: string;
|
||||||
target: string;
|
target: string;
|
||||||
binary: string;
|
binary: string;
|
||||||
description: string;
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PLATFORMS: PlatformTarget[] = [
|
export const PLATFORMS: PlatformTarget[] = [
|
||||||
{ dir: "darwin-arm64", target: "bun-darwin-arm64", binary: "oh-my-opencode", description: "macOS ARM64" },
|
{ platform: "darwin-arm64", packageName: "oh-my-opencode-darwin-arm64", packageDir: "oh-my-opencode-darwin-arm64", target: "bun-darwin-arm64", binary: "oh-my-opencode", description: "macOS ARM64" },
|
||||||
{ dir: "darwin-x64", target: "bun-darwin-x64", binary: "oh-my-opencode", description: "macOS x64" },
|
{ platform: "darwin-x64", packageName: "oh-my-opencode-darwin-x64", packageDir: "oh-my-opencode-darwin-x64", target: "bun-darwin-x64", binary: "oh-my-opencode", description: "macOS x64" },
|
||||||
{ dir: "darwin-x64-baseline", target: "bun-darwin-x64-baseline", binary: "oh-my-opencode", description: "macOS x64 (no AVX2)" },
|
{ platform: "darwin-x64-baseline", packageName: "oh-my-opencode-darwin-x64-baseline", packageDir: "oh-my-opencode-darwin-x64-baseline", target: "bun-darwin-x64-baseline", binary: "oh-my-opencode", description: "macOS x64 (no AVX2)" },
|
||||||
{ dir: "linux-x64", target: "bun-linux-x64", binary: "oh-my-opencode", description: "Linux x64 (glibc)" },
|
{ platform: "linux-x64", packageName: "oh-my-opencode-linux-x64", packageDir: "oh-my-opencode-linux-x64", target: "bun-linux-x64", binary: "oh-my-opencode", description: "Linux x64 (glibc)" },
|
||||||
{ dir: "linux-x64-baseline", target: "bun-linux-x64-baseline", binary: "oh-my-opencode", description: "Linux x64 (glibc, no AVX2)" },
|
{ platform: "linux-x64-baseline", packageName: "oh-my-opencode-linux-x64-baseline", packageDir: "oh-my-opencode-linux-x64-baseline", target: "bun-linux-x64-baseline", binary: "oh-my-opencode", description: "Linux x64 (glibc, no AVX2)" },
|
||||||
{ dir: "linux-arm64", target: "bun-linux-arm64", binary: "oh-my-opencode", description: "Linux ARM64 (glibc)" },
|
{ platform: "linux-arm64", packageName: "oh-my-opencode-linux-arm64", packageDir: "oh-my-opencode-linux-arm64", target: "bun-linux-arm64", binary: "oh-my-opencode", description: "Linux ARM64 (glibc)" },
|
||||||
{ dir: "linux-x64-musl", target: "bun-linux-x64-musl", binary: "oh-my-opencode", description: "Linux x64 (musl)" },
|
{ platform: "linux-x64-musl", packageName: "oh-my-opencode-linux-x64-musl", packageDir: "oh-my-opencode-linux-x64-musl", target: "bun-linux-x64-musl", binary: "oh-my-opencode", description: "Linux x64 (musl)" },
|
||||||
{ dir: "linux-x64-musl-baseline", target: "bun-linux-x64-musl-baseline", binary: "oh-my-opencode", description: "Linux x64 (musl, no AVX2)" },
|
{ platform: "linux-x64-musl-baseline", packageName: "oh-my-opencode-linux-x64-musl-baseline", packageDir: "oh-my-opencode-linux-x64-musl-baseline", target: "bun-linux-x64-musl-baseline", binary: "oh-my-opencode", description: "Linux x64 (musl, no AVX2)" },
|
||||||
{ dir: "linux-arm64-musl", target: "bun-linux-arm64-musl", binary: "oh-my-opencode", description: "Linux ARM64 (musl)" },
|
{ platform: "linux-arm64-musl", packageName: "oh-my-opencode-linux-arm64-musl", packageDir: "oh-my-opencode-linux-arm64-musl", target: "bun-linux-arm64-musl", binary: "oh-my-opencode", description: "Linux ARM64 (musl)" },
|
||||||
{ dir: "windows-x64", target: "bun-windows-x64", binary: "oh-my-opencode.exe", description: "Windows x64" },
|
{ platform: "windows-x64", packageName: "oh-my-opencode-windows-x64", packageDir: "oh-my-opencode-windows-x64", target: "bun-windows-x64", binary: "oh-my-opencode.exe", description: "Windows x64" },
|
||||||
{ dir: "windows-x64-baseline", target: "bun-windows-x64-baseline", binary: "oh-my-opencode.exe", description: "Windows x64 (no AVX2)" },
|
{ platform: "windows-x64-baseline", packageName: "oh-my-opencode-windows-x64-baseline", packageDir: "oh-my-opencode-windows-x64-baseline", target: "bun-windows-x64-baseline", binary: "oh-my-opencode.exe", description: "Windows x64 (no AVX2)" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const ENTRY_POINT = "src/cli/index.ts";
|
const ENTRY_POINT = "src/cli/index.ts";
|
||||||
|
|
||||||
async function buildPlatform(platform: PlatformTarget): Promise<boolean> {
|
async function buildPlatform(platform: PlatformTarget): Promise<boolean> {
|
||||||
const outfile = join("packages", platform.dir, "bin", platform.binary);
|
const outfile = join("packages", platform.packageDir, "bin", platform.binary);
|
||||||
|
|
||||||
console.log(`\n📦 Building ${platform.description}...`);
|
console.log(`\n📦 Building ${platform.description}...`);
|
||||||
console.log(` Target: ${platform.target}`);
|
console.log(` Target: ${platform.target}`);
|
||||||
|
|||||||
+23
-14
@@ -10,15 +10,24 @@ const versionOverride = process.env.VERSION
|
|||||||
const republishMode = process.env.REPUBLISH === "true"
|
const republishMode = process.env.REPUBLISH === "true"
|
||||||
const prepareOnly = process.argv.includes("--prepare-only")
|
const prepareOnly = process.argv.includes("--prepare-only")
|
||||||
|
|
||||||
const PLATFORM_PACKAGES = [
|
const PLATFORM_PACKAGE_IDS = [
|
||||||
"darwin-arm64",
|
"darwin-arm64",
|
||||||
"darwin-x64",
|
"darwin-x64",
|
||||||
|
"darwin-x64-baseline",
|
||||||
"linux-x64",
|
"linux-x64",
|
||||||
|
"linux-x64-baseline",
|
||||||
"linux-arm64",
|
"linux-arm64",
|
||||||
"linux-x64-musl",
|
"linux-x64-musl",
|
||||||
|
"linux-x64-musl-baseline",
|
||||||
"linux-arm64-musl",
|
"linux-arm64-musl",
|
||||||
"windows-x64",
|
"windows-x64",
|
||||||
]
|
] as const
|
||||||
|
|
||||||
|
const PLATFORM_PACKAGES = PLATFORM_PACKAGE_IDS.map((platform) => ({
|
||||||
|
platform,
|
||||||
|
packageName: `${PACKAGE_NAME}-${platform}`,
|
||||||
|
packageDir: `${PACKAGE_NAME}-${platform}`,
|
||||||
|
}))
|
||||||
|
|
||||||
console.log("=== Publishing oh-my-opencode (multi-package) ===\n")
|
console.log("=== Publishing oh-my-opencode (multi-package) ===\n")
|
||||||
|
|
||||||
@@ -65,8 +74,8 @@ async function updateAllPackageVersions(newVersion: string): Promise<void> {
|
|||||||
|
|
||||||
// Update optionalDependencies versions in main package.json
|
// Update optionalDependencies versions in main package.json
|
||||||
let mainPkg = await Bun.file(mainPkgPath).text()
|
let mainPkg = await Bun.file(mainPkgPath).text()
|
||||||
for (const platform of PLATFORM_PACKAGES) {
|
for (const platformPackage of PLATFORM_PACKAGES) {
|
||||||
const pkgName = `oh-my-opencode-${platform}`
|
const pkgName = platformPackage.packageName
|
||||||
mainPkg = mainPkg.replace(
|
mainPkg = mainPkg.replace(
|
||||||
new RegExp(`"${pkgName}": "[^"]+"`),
|
new RegExp(`"${pkgName}": "[^"]+"`),
|
||||||
`"${pkgName}": "${newVersion}"`
|
`"${pkgName}": "${newVersion}"`
|
||||||
@@ -75,8 +84,8 @@ async function updateAllPackageVersions(newVersion: string): Promise<void> {
|
|||||||
await Bun.write(mainPkgPath, mainPkg)
|
await Bun.write(mainPkgPath, mainPkg)
|
||||||
|
|
||||||
// Update each platform package.json
|
// Update each platform package.json
|
||||||
for (const platform of PLATFORM_PACKAGES) {
|
for (const platformPackage of PLATFORM_PACKAGES) {
|
||||||
const pkgPath = new URL(`../packages/${platform}/package.json`, import.meta.url).pathname
|
const pkgPath = new URL(`../packages/${platformPackage.packageDir}/package.json`, import.meta.url).pathname
|
||||||
if (existsSync(pkgPath)) {
|
if (existsSync(pkgPath)) {
|
||||||
await updatePackageVersion(pkgPath, newVersion)
|
await updatePackageVersion(pkgPath, newVersion)
|
||||||
} else {
|
} else {
|
||||||
@@ -266,16 +275,16 @@ async function publishAllPackages(version: string): Promise<void> {
|
|||||||
const batchNum = Math.floor(i / BATCH_SIZE) + 1
|
const batchNum = Math.floor(i / BATCH_SIZE) + 1
|
||||||
const totalBatches = Math.ceil(PLATFORM_PACKAGES.length / BATCH_SIZE)
|
const totalBatches = Math.ceil(PLATFORM_PACKAGES.length / BATCH_SIZE)
|
||||||
|
|
||||||
console.log(`\n Batch ${batchNum}/${totalBatches}: ${batch.join(", ")}`)
|
console.log(`\n Batch ${batchNum}/${totalBatches}: ${batch.map((platformPackage) => platformPackage.platform).join(", ")}`)
|
||||||
|
|
||||||
const publishPromises = batch.map(async (platform) => {
|
const publishPromises = batch.map(async (platformPackage) => {
|
||||||
const pkgDir = join(process.cwd(), "packages", platform)
|
const pkgDir = join(process.cwd(), "packages", platformPackage.packageDir)
|
||||||
const pkgName = `oh-my-opencode-${platform}`
|
const pkgName = platformPackage.packageName
|
||||||
|
|
||||||
console.log(` Starting ${pkgName}...`)
|
console.log(` Starting ${pkgName}...`)
|
||||||
const result = await publishPackage(pkgDir, distTag, false, pkgName, version)
|
const result = await publishPackage(pkgDir, distTag, false, pkgName, version)
|
||||||
|
|
||||||
return { platform, pkgName, result }
|
return { platform: platformPackage.platform, pkgName, result }
|
||||||
})
|
})
|
||||||
|
|
||||||
const results = await Promise.all(publishPromises)
|
const results = await Promise.all(publishPromises)
|
||||||
@@ -338,8 +347,8 @@ async function gitTagAndRelease(newVersion: string, notes: string[]): Promise<vo
|
|||||||
|
|
||||||
// Add all package.json files
|
// Add all package.json files
|
||||||
await $`git add package.json assets/oh-my-opencode.schema.json`
|
await $`git add package.json assets/oh-my-opencode.schema.json`
|
||||||
for (const platform of PLATFORM_PACKAGES) {
|
for (const platformPackage of PLATFORM_PACKAGES) {
|
||||||
await $`git add packages/${platform}/package.json`.nothrow()
|
await $`git add packages/${platformPackage.packageDir}/package.json`.nothrow()
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasStagedChanges = await $`git diff --cached --quiet`.nothrow()
|
const hasStagedChanges = await $`git diff --cached --quiet`.nothrow()
|
||||||
@@ -417,7 +426,7 @@ async function main() {
|
|||||||
await publishAllPackages(newVersion)
|
await publishAllPackages(newVersion)
|
||||||
await gitTagAndRelease(newVersion, notes)
|
await gitTagAndRelease(newVersion, notes)
|
||||||
|
|
||||||
console.log(`\n=== Successfully published ${PACKAGE_NAME}@${newVersion} (8 packages) ===`)
|
console.log(`\n=== Successfully published ${PACKAGE_NAME}@${newVersion} (${PLATFORM_PACKAGES.length + 1} packages) ===`)
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user