Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 34 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [ main ]
branches: [ main, dev ]
pull_request:
branches: [ main ]
workflow_dispatch:
Expand Down Expand Up @@ -42,14 +42,26 @@ jobs:
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: dotnet test Nayvid.Gemini.slnx --configuration Release --no-build --verbosity normal

- name: Determine changed projects
id: changed
shell: bash
run: |
git fetch origin main --depth=1 || true
BASE="origin/main"
if ! git rev-parse --verify origin/main; then BASE=$(git rev-list --max-parents=0 HEAD | tail -n1); fi
echo "Base ref: $BASE"
CHANGED=$(git diff --name-only "$BASE"...HEAD)
# Try triple-dot diff (merge-base). If no merge base (unrelated history), fall back to two-dot or full file list.
if git merge-base "$BASE" HEAD >/dev/null 2>&1; then
CHANGED=$(git diff --name-only "$BASE"...HEAD)
else
echo "No merge base with $BASE; using direct range diff."
CHANGED=$(git diff --name-only "$BASE" HEAD || true)
if [[ -z $CHANGED ]]; then
echo "Range diff empty; falling back to listing all tracked files."
CHANGED=$(git ls-files)
fi
fi
echo "Changed files:\n$CHANGED"
# Map to project directories
PROJECTS=()
Expand All @@ -68,15 +80,15 @@ jobs:
done
fi
done
# Always include core if any project changed
if [[ ${#PROJECTS[@]} -gt 0 ]]; then PROJECTS+=("Nayvid.Gemini.Core/Nayvid.Gemini.Core.csproj"); fi
# (Core auto-include removed – adjust if a shared core project is added later)
# Unique
UNIQUE=$(printf '%s\n' "${PROJECTS[@]}" | sort -u)
echo "Projects to pack:\n$UNIQUE"
LIST=$(echo "$UNIQUE" | paste -sd ',' -)
echo "pack_list=$LIST" >> $GITHUB_OUTPUT
- name: Derive version
id: version
shell: bash
run: |
# Derive version from workflow input, commit message (release: x.y.z) or fallback to 0.1.0+<shortsha>
INPUT_VER="${{ github.event.inputs.release_version }}"
Expand All @@ -86,14 +98,23 @@ jobs:
VER="${BASH_REMATCH[1]}"
else
SHORT=$(git rev-parse --short HEAD)
VER="0.1.0-$SHORT"
# Branch-aware prerelease tagging: dev -> -dev.<sha>, other branches -> -beta.<branch>.<sha>
if [[ "$GITHUB_REF_NAME" == "dev" ]]; then
VER="0.1.0-dev.$SHORT"
elif [[ "$GITHUB_REF_TYPE" == "branch" && "$GITHUB_REF_NAME" != "main" ]]; then
SAFE_BRANCH=$(echo "$GITHUB_REF_NAME" | tr '/' '-')
VER="0.1.0-beta.$SAFE_BRANCH.$SHORT"
else
VER="0.1.0-$SHORT"
fi
fi
fi
echo "Using version: $VER"
echo "version=$VER" >> $GITHUB_OUTPUT

- name: Pack changed projects
if: steps.changed.outputs.pack_list != ''
shell: bash
run: |
IFS=',' read -ra ARR <<< "${{ steps.changed.outputs.pack_list }}"
mkdir -p artifacts
Expand Down Expand Up @@ -125,6 +146,7 @@ jobs:

- name: Create/Update freeze branch
if: ${{ github.event.inputs.create_release == 'true' || startsWith(github.event.head_commit.message, 'release:') }}
shell: bash
run: |
VER="${{ needs.build-test-pack.outputs.derived_version }}"
git config --global user.name "github-actions"
Expand All @@ -142,8 +164,12 @@ jobs:
- name: Publish to NuGet (manual approval gated env)
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
if: secrets.NUGET_API_KEY != ''
shell: bash
run: |
if [ -z "$NUGET_API_KEY" ]; then
echo "NUGET_API_KEY not set; skipping NuGet publish."
exit 0
fi
for f in artifacts/*.nupkg; do
echo "Pushing $f"
dotnet nuget push "$f" --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
Expand All @@ -153,12 +179,12 @@ jobs:
if: github.repository_owner != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
OWNER=${{ github.repository_owner }}
for f in artifacts/*.nupkg; do
echo "Publishing $f to GitHub Packages"
dotnet nuget push "$f" --api-key "$GITHUB_TOKEN" --source https://nuget.pkg.github.com/$OWNER/index.json --skip-duplicate
done

- name: Publish packages
if: false # legacy step disabled
# Removed invalid empty step placeholder that caused workflow lint error
69 changes: 69 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Console Demo",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/samples/Nayvid.ConsoleDemo/bin/Debug/net9.0/ConsoleDemo.dll",
"preLaunchTask": "build ConsoleDemo",
"cwd": "${workspaceFolder}",
// GEMINI_API_KEY taken from shell environment. Set before F5: $Env:GEMINI_API_KEY = 'real_key'
"env": {},
"console": "integratedTerminal"
},
{
"name": "Run ASP.NET Sample",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/samples/Nayvid.AspNetSample/bin/Debug/net9.0/Nayvid.AspNetSample.dll",
"preLaunchTask": "build AspNetSample",
"cwd": "${workspaceFolder}/samples/Nayvid.AspNetSample",
"env": { "ASPNETCORE_URLS": "http://localhost:5000" },
"serverReadyAction": {
"action": "openExternally",
"pattern": "Now listening on: (https?://\\S+)"
}
},
{
"name": "Run Blazor Sample (WASM)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/samples/Nayvid.BlazorSample/bin/Debug/net9.0/Nayvid.BlazorSample.dll",
"preLaunchTask": "build BlazorSample",
"cwd": "${workspaceFolder}/samples/Nayvid.BlazorSample",
"env": {},
"serverReadyAction": {
"action": "openExternally",
"pattern": "Now listening on: (https?://\\S+)"
}
},
{
"name": "Run Real API Sample",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/samples/Nayvid.RealApiSample/bin/Debug/net9.0/Nayvid.RealApiSample.dll",
"preLaunchTask": "build RealApiSample",
"cwd": "${workspaceFolder}",
"env": {},
"console": "integratedTerminal"
},
{
"name": "Run Real Video Sample",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/samples/Nayvid.RealVideoSample/bin/Debug/net9.0/Nayvid.RealVideoSample.dll",
"preLaunchTask": "build RealVideoSample",
"cwd": "${workspaceFolder}",
"env": {},
"args": ["A close up cinematic shot of ocean waves glistening at sunrise"],
"console": "integratedTerminal"
}
],
"compounds": [
{
"name": "API + Blazor",
"configurations": ["Run ASP.NET Sample", "Run Blazor Sample (WASM)"]
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"FSharp.suggestGitignore": false
}
40 changes: 40 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build ConsoleDemo",
"type": "shell",
"command": "dotnet build samples/Nayvid.ConsoleDemo/ConsoleDemo.csproj",
"problemMatcher": "$msCompile",
"group": "build"
},
{
"label": "build AspNetSample",
"type": "shell",
"command": "dotnet build samples/Nayvid.AspNetSample/Nayvid.AspNetSample.csproj",
"problemMatcher": "$msCompile",
"group": "build"
},
{
"label": "build BlazorSample",
"type": "shell",
"command": "dotnet build samples/Nayvid.BlazorSample/Nayvid.BlazorSample.csproj",
"problemMatcher": "$msCompile",
"group": "build"
},
{
"label": "build RealApiSample",
"type": "shell",
"command": "dotnet build samples/Nayvid.RealApiSample/Nayvid.RealApiSample.csproj",
"problemMatcher": "$msCompile",
"group": "build"
},
{
"label": "build RealVideoSample",
"type": "shell",
"command": "dotnet build samples/Nayvid.RealVideoSample/Nayvid.RealVideoSample.csproj",
"problemMatcher": "$msCompile",
"group": "build"
}
]
}
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added Acme.Gemini.Video/README.md
Empty file.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
MIT License

Copyright (c) 2025 Nayvid

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.MIT License

Copyright (c) 2025 Nayvid Technology LLP

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Empty file added Ngemini/GeminiApiException.cs
Empty file.
Empty file.
Empty file added Ngemini/GeminiVideoClient.cs
Empty file.
Empty file added Ngemini/GeminiVideoClient.xml
Empty file.
Empty file.
Empty file added Ngemini/IGeminiVideoClient.cs
Empty file.
Empty file.
Empty file added Ngemini/Models/GeminiError.cs
Empty file.
Empty file added Ngemini/Models/GenerateChunk.cs
Empty file.
Empty file.
Empty file added Ngemini/Models/Operation.cs
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added Ngemini/Models/UploadSession.cs
Empty file.
Empty file added Ngemini/Models/UploadedMedia.cs
Empty file.
Empty file added Ngemini/Models/VideoPart.cs
Empty file.
Empty file.
Loading
Loading