From 33b3c04f94d7df5f96101f93f97d10a459640045 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 14:44:05 +0000 Subject: [PATCH] fix: robust GitHub Actions publishing workflow - Fixed `publish.yml` to handle initial package publications (first-time publishing). - Added version-check protection to avoid redundant publish attempts. - Added `NPM_TOKEN` verification step for better error debugging. - Ensured all packages have `publishConfig` for public NPM registry. - Standardized package naming and synchronization for CI/CD. Co-authored-by: codedbytahir <200578194+codedbytahir@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 43 ++++++++++++++++++------ README.md | 32 +++++------------- packages/create-motionforge/package.json | 4 +++ packages/motionforge/README.md | 2 +- 5 files changed, 47 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7efa65..0afb7e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,5 +42,5 @@ jobs: run: | cd packages/create-motionforge bun install - # No build script for CLI yet as it is direct JS, but verify it exists + # Verify binary exists ls bin/index.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a4c91fa..03f602e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,42 +32,65 @@ jobs: restore-keys: | ${{ runner.os }}-bun- - - name: Install Dependencies - run: bun install + - name: Verify NPM Token + run: | + if [ -z "${{ secrets.NPM_TOKEN }}" ]; then + echo "::error::NPM_TOKEN is missing. Please add it to your GitHub Repository Secrets." + exit 1 + fi - name: Publish MotionForge run: | + echo "Processing motionforge..." cd packages/motionforge bun install bun run build - # Only publish if version changed + PACKAGE_NAME=$(node -p "require('./package.json').name") CURRENT_VERSION=$(node -p "require('./package.json').version") - NPM_VERSION=$(npm view motionforge version 2>/dev/null || echo "0.0.0") + + echo "Checking if $PACKAGE_NAME@$CURRENT_VERSION is already published..." + # Use || true to prevent exit on error if package doesn't exist + NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "") + + if [ -z "$NPM_VERSION" ]; then + echo "Package $PACKAGE_NAME not found on NPM. Initial publication." + NPM_VERSION="0.0.0" + fi if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then - echo "Publishing motionforge@$CURRENT_VERSION..." + echo "New version detected: $CURRENT_VERSION (NPM has $NPM_VERSION). Publishing..." npm publish --access public --provenance + echo "Successfully published $PACKAGE_NAME@$CURRENT_VERSION" else - echo "motionforge@$CURRENT_VERSION is already published." + echo "$PACKAGE_NAME@$CURRENT_VERSION is already up to date on NPM." fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish Create-MotionForge run: | + echo "Processing create-motionforge..." cd packages/create-motionforge bun install - # Only publish if version changed + PACKAGE_NAME=$(node -p "require('./package.json').name") CURRENT_VERSION=$(node -p "require('./package.json').version") - NPM_VERSION=$(npm view create-motionforge version 2>/dev/null || echo "0.0.0") + + echo "Checking if $PACKAGE_NAME@$CURRENT_VERSION is already published..." + NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "") + + if [ -z "$NPM_VERSION" ]; then + echo "Package $PACKAGE_NAME not found on NPM. Initial publication." + NPM_VERSION="0.0.0" + fi if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then - echo "Publishing create-motionforge@$CURRENT_VERSION..." + echo "New version detected: $CURRENT_VERSION (NPM has $NPM_VERSION). Publishing..." npm publish --access public --provenance + echo "Successfully published $PACKAGE_NAME@$CURRENT_VERSION" else - echo "create-motionforge@$CURRENT_VERSION is already published." + echo "$PACKAGE_NAME@$CURRENT_VERSION is already up to date on NPM." fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 9585b9e..bc266f0 100755 --- a/README.md +++ b/README.md @@ -58,28 +58,17 @@ This scaffold provides a robust foundation built with: ## 🚀 Quick Start -There are two ways to use MotionForge depending on your needs: - -### 1. Starting a New Project (Recommended) -Use the CLI to bootstrap a complete video project with templates and configurations ready to go. +The fastest way to get started with MotionForge is by using the CLI tool: ```bash -# This will work once you publish the package to NPM npx create-motionforge@latest ``` -**Note:** If you haven't published to NPM yet, you can test it locally from this repo: -```bash -cd packages/create-motionforge -bun run start -``` - -### 2. Adding to an Existing Project -If you already have a Next.js or React project, just install the library: - -```bash -npm install motionforge -``` +This will guide you through: +- 📁 Choosing a project name +- 🎨 Selecting a template (**Hello World** or **Blank**) +- 💅 Adding **Tailwind CSS** support +- 🤖 Including **AI Agent Guidelines** (Google Gemini/Z.ai GLM) ## 🛠️ Development Setup (for Framework Contributors) @@ -150,17 +139,12 @@ This scaffold includes a comprehensive set of modern web development tools: MotionForge is a high-performance, React-based programmatic video framework. It is designed to be a modern alternative to Remotion, offering seamless integration with Next.js and Tailwind CSS. -### 🚀 Getting Started -To create a new project: +### 🚀 Getting Started with the CLI +You can create a new MotionForge project in seconds: ```bash npx create-motionforge@latest ``` -To add to an existing project: -```bash -npm install motionforge -``` - ### Key Features: - **Frame-Perfect Rendering**: deterministic animations driven by frame number. - **High-Speed Export**: Frame-by-frame video export using WebCodecs. diff --git a/packages/create-motionforge/package.json b/packages/create-motionforge/package.json index b1c4817..19c7ab3 100644 --- a/packages/create-motionforge/package.json +++ b/packages/create-motionforge/package.json @@ -24,5 +24,9 @@ "fs-extra": "^11.3.3", "inquirer": "^13.2.2", "ora": "8.0.1" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org" } } diff --git a/packages/motionforge/README.md b/packages/motionforge/README.md index 19a6ed0..b450538 100644 --- a/packages/motionforge/README.md +++ b/packages/motionforge/README.md @@ -21,7 +21,7 @@ - 📊 **Interpolation System** - Smooth transitions with 20+ easing functions - 🎮 **Interactive Player** - Real-time preview with timeline controls - 📦 **Frame Caching** - LRU cache for optimized performance -- 🎥 **Video Export** - High-performance WebCodecs & Frame-by-frame rendering +- 🎥 **Video Export** - WebM encoding with MediaRecorder API - 🎯 **TypeScript First** - Full type safety out of the box ## 📦 Installation