mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
Refactor and update various components of EchoHub.Server
- Updated launchSettings.json for consistency. - Refactored FileValidationHelper to improve image validation logic. - Enhanced ServerDirectoryService for better connection handling and user count updates. - Improved DatabaseSetup for legacy database handling and seeding default channels. - Refined FirstRunSetup to ensure JWT secret generation. - Removed appsettings.Development.json as it is no longer needed. - Updated EchoHub.Tests project file for consistency. - Added unit tests for FileValidationHelper and PresenceTracker with improved assertions. - Updated ValidationConstantsTests to ensure regex validations are correct. - Cleaned up solution file formatting for better readability.
This commit is contained in:
@@ -1,79 +1,79 @@
|
||||
name: Bug report
|
||||
description: Report a reproducible bug
|
||||
title: "bug: "
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to report a bug.
|
||||
|
||||
If this is a security issue (auth bypass, token leak, file upload exploit, etc.), please follow SECURITY.md instead of filing a public issue.
|
||||
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: Affected component
|
||||
options:
|
||||
- Client (EchoHub.Client)
|
||||
- Server (EchoHub.Server)
|
||||
- Core/shared (EchoHub.Core)
|
||||
- Docs
|
||||
- CI
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Describe the bug and what you expected to happen.
|
||||
placeholder: "When I..., I expected..., but ..."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: repro
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Include minimal, numbered steps.
|
||||
placeholder: |
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs / stack traces
|
||||
description: Paste relevant logs (redact tokens/secrets).
|
||||
render: text
|
||||
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: App version, commit SHA, or release tag.
|
||||
placeholder: v0.1.0
|
||||
|
||||
- type: textarea
|
||||
id: environment
|
||||
attributes:
|
||||
label: Environment
|
||||
description: OS, terminal, .NET SDK version.
|
||||
placeholder: |
|
||||
OS: Windows 11
|
||||
Terminal: Windows Terminal
|
||||
.NET SDK: 10.0.x
|
||||
|
||||
- type: checkboxes
|
||||
id: confirmations
|
||||
attributes:
|
||||
label: Confirmations
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate
|
||||
required: true
|
||||
- label: I removed sensitive info (tokens/keys) from logs
|
||||
required: true
|
||||
name: Bug report
|
||||
description: Report a reproducible bug
|
||||
title: "bug: "
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to report a bug.
|
||||
|
||||
If this is a security issue (auth bypass, token leak, file upload exploit, etc.), please follow SECURITY.md instead of filing a public issue.
|
||||
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: Affected component
|
||||
options:
|
||||
- Client (EchoHub.Client)
|
||||
- Server (EchoHub.Server)
|
||||
- Core/shared (EchoHub.Core)
|
||||
- Docs
|
||||
- CI
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Describe the bug and what you expected to happen.
|
||||
placeholder: "When I..., I expected..., but ..."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: repro
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Include minimal, numbered steps.
|
||||
placeholder: |
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs / stack traces
|
||||
description: Paste relevant logs (redact tokens/secrets).
|
||||
render: text
|
||||
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: App version, commit SHA, or release tag.
|
||||
placeholder: v0.1.0
|
||||
|
||||
- type: textarea
|
||||
id: environment
|
||||
attributes:
|
||||
label: Environment
|
||||
description: OS, terminal, .NET SDK version.
|
||||
placeholder: |
|
||||
OS: Windows 11
|
||||
Terminal: Windows Terminal
|
||||
.NET SDK: 10.0.x
|
||||
|
||||
- type: checkboxes
|
||||
id: confirmations
|
||||
attributes:
|
||||
label: Confirmations
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate
|
||||
required: true
|
||||
- label: I removed sensitive info (tokens/keys) from logs
|
||||
required: true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Security policy
|
||||
url: https://github.com/HueByte/EchoHub/security/policy
|
||||
about: Please report security vulnerabilities here (or see SECURITY.md).
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Security policy
|
||||
url: https://github.com/HueByte/EchoHub/security/policy
|
||||
about: Please report security vulnerabilities here (or see SECURITY.md).
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea or improvement
|
||||
title: "feat: "
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for suggesting an improvement.
|
||||
|
||||
EchoHub tries to stay lightweight: terminal-first, self-hosted, and no upsells.
|
||||
|
||||
- type: dropdown
|
||||
id: area
|
||||
attributes:
|
||||
label: Area
|
||||
options:
|
||||
- Client (TUI)
|
||||
- Server (API/SignalR)
|
||||
- Auth/security
|
||||
- Files/uploads
|
||||
- Docs
|
||||
- Build/CI
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
label: What problem are you trying to solve?
|
||||
placeholder: "It’s hard to..., because ..."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: proposal
|
||||
attributes:
|
||||
label: Proposed solution
|
||||
placeholder: "Add/Change ..., so that ..."
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives considered
|
||||
description: Any other approaches you’ve thought about.
|
||||
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Mockups, examples, links, etc.
|
||||
name: Feature request
|
||||
description: Suggest an idea or improvement
|
||||
title: "feat: "
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for suggesting an improvement.
|
||||
|
||||
EchoHub tries to stay lightweight: terminal-first, self-hosted, and no upsells.
|
||||
|
||||
- type: dropdown
|
||||
id: area
|
||||
attributes:
|
||||
label: Area
|
||||
options:
|
||||
- Client (TUI)
|
||||
- Server (API/SignalR)
|
||||
- Auth/security
|
||||
- Files/uploads
|
||||
- Docs
|
||||
- Build/CI
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
label: What problem are you trying to solve?
|
||||
placeholder: "It’s hard to..., because ..."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: proposal
|
||||
attributes:
|
||||
label: Proposed solution
|
||||
placeholder: "Add/Change ..., so that ..."
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives considered
|
||||
description: Any other approaches you’ve thought about.
|
||||
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Mockups, examples, links, etc.
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
# Summary
|
||||
|
||||
<!-- What does this PR change, and why? Keep it brief. -->
|
||||
|
||||
## Changes
|
||||
|
||||
- Describe the changes here
|
||||
|
||||
## Screenshots / recordings (optional)
|
||||
|
||||
<!-- If you changed the TUI UI/UX, add a screenshot or short recording. -->
|
||||
|
||||
## How to test
|
||||
|
||||
- [ ] `dotnet build src/EchoHub.slnx`
|
||||
- [ ] `dotnet test src/EchoHub.slnx`
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I ran tests locally (or explained why not)
|
||||
- [ ] I kept changes focused and easy to review
|
||||
- [ ] I updated docs where needed (README/docs)
|
||||
- [ ] I verified no secrets/keys are committed
|
||||
- [ ] If this touches files/uploads/auth, I considered security implications
|
||||
|
||||
## Related issues
|
||||
|
||||
- Closes #
|
||||
# Summary
|
||||
|
||||
<!-- What does this PR change, and why? Keep it brief. -->
|
||||
|
||||
## Changes
|
||||
|
||||
- Describe the changes here
|
||||
|
||||
## Screenshots / recordings (optional)
|
||||
|
||||
<!-- If you changed the TUI UI/UX, add a screenshot or short recording. -->
|
||||
|
||||
## How to test
|
||||
|
||||
- [ ] `dotnet build src/EchoHub.slnx`
|
||||
- [ ] `dotnet test src/EchoHub.slnx`
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I ran tests locally (or explained why not)
|
||||
- [ ] I kept changes focused and easy to review
|
||||
- [ ] I updated docs where needed (README/docs)
|
||||
- [ ] I verified no secrets/keys are committed
|
||||
- [ ] If this touches files/uploads/auth, I considered security implications
|
||||
|
||||
## Related issues
|
||||
|
||||
- Closes #
|
||||
|
||||
+165
-165
@@ -1,165 +1,165 @@
|
||||
name: CI / Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
lint-markdown:
|
||||
name: Markdown Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run markdownlint
|
||||
run: bash scripts/lint-markdown.sh
|
||||
|
||||
detect-changes:
|
||||
name: Detect Changes
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
src_changed: ${{ steps.check.outputs.src_changed }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check for changes
|
||||
id: check
|
||||
env:
|
||||
BEFORE: ${{ github.event.before }}
|
||||
run: |
|
||||
if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then
|
||||
# Initial push — treat everything as changed
|
||||
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
SRC_CHANGED=$(git diff --name-only "$BEFORE" HEAD -- 'src/' | wc -l)
|
||||
|
||||
[ "$SRC_CHANGED" -gt 0 ] && echo "src_changed=true" >> "$GITHUB_OUTPUT" || echo "src_changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
test:
|
||||
name: Build & Test
|
||||
needs: [lint-markdown, detect-changes]
|
||||
if: needs.detect-changes.outputs.src_changed == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore src/EchoHub.slnx
|
||||
|
||||
- name: Build
|
||||
run: dotnet build src/EchoHub.slnx --no-restore --configuration Release
|
||||
|
||||
- name: Test
|
||||
run: dotnet test src/EchoHub.slnx --no-build --configuration Release --verbosity normal
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
needs: [lint-markdown, detect-changes, test]
|
||||
if: needs.detect-changes.outputs.src_changed == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Read version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(grep -oP '(?<=<Version>)[^<]+' src/Directory.Build.props)
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Check if release exists
|
||||
id: check_release
|
||||
run: |
|
||||
if gh release view "${{ steps.version.outputs.tag }}" &>/dev/null; then
|
||||
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish Server win-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r win-x64 --self-contained true -o publish/server-win-x64
|
||||
|
||||
- name: Publish Server linux-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r linux-x64 --self-contained true -o publish/server-linux-x64
|
||||
|
||||
- name: Publish Server osx-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-x64 --self-contained true -o publish/server-osx-x64
|
||||
|
||||
- name: Publish Server osx-arm64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-arm64 --self-contained true -o publish/server-osx-arm64
|
||||
|
||||
- name: Publish Client win-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r win-x64 --self-contained true -o publish/client-win-x64
|
||||
|
||||
- name: Publish Client linux-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r linux-x64 --self-contained true -o publish/client-linux-x64
|
||||
|
||||
- name: Publish Client osx-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-x64 --self-contained true -o publish/client-osx-x64
|
||||
|
||||
- name: Publish Client osx-arm64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-arm64 --self-contained true -o publish/client-osx-arm64
|
||||
|
||||
- name: Zip artifacts
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: |
|
||||
cd publish
|
||||
zip -r ../EchoHub-Server-win-x64.zip server-win-x64/
|
||||
zip -r ../EchoHub-Server-linux-x64.zip server-linux-x64/
|
||||
zip -r ../EchoHub-Server-osx-x64.zip server-osx-x64/
|
||||
zip -r ../EchoHub-Server-osx-arm64.zip server-osx-arm64/
|
||||
zip -r ../EchoHub-Client-win-x64.zip client-win-x64/
|
||||
zip -r ../EchoHub-Client-linux-x64.zip client-linux-x64/
|
||||
zip -r ../EchoHub-Client-osx-x64.zip client-osx-x64/
|
||||
zip -r ../EchoHub-Client-osx-arm64.zip client-osx-arm64/
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: |
|
||||
gh release create "${{ steps.version.outputs.tag }}" \
|
||||
--title "EchoHub ${{ steps.version.outputs.tag }}" \
|
||||
--generate-notes \
|
||||
EchoHub-Server-win-x64.zip \
|
||||
EchoHub-Server-linux-x64.zip \
|
||||
EchoHub-Server-osx-x64.zip \
|
||||
EchoHub-Server-osx-arm64.zip \
|
||||
EchoHub-Client-win-x64.zip \
|
||||
EchoHub-Client-linux-x64.zip \
|
||||
EchoHub-Client-osx-x64.zip \
|
||||
EchoHub-Client-osx-arm64.zip
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: CI / Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
lint-markdown:
|
||||
name: Markdown Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run markdownlint
|
||||
run: bash scripts/lint-markdown.sh
|
||||
|
||||
detect-changes:
|
||||
name: Detect Changes
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
src_changed: ${{ steps.check.outputs.src_changed }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check for changes
|
||||
id: check
|
||||
env:
|
||||
BEFORE: ${{ github.event.before }}
|
||||
run: |
|
||||
if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then
|
||||
# Initial push — treat everything as changed
|
||||
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
SRC_CHANGED=$(git diff --name-only "$BEFORE" HEAD -- 'src/' | wc -l)
|
||||
|
||||
[ "$SRC_CHANGED" -gt 0 ] && echo "src_changed=true" >> "$GITHUB_OUTPUT" || echo "src_changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
test:
|
||||
name: Build & Test
|
||||
needs: [lint-markdown, detect-changes]
|
||||
if: needs.detect-changes.outputs.src_changed == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore src/EchoHub.slnx
|
||||
|
||||
- name: Build
|
||||
run: dotnet build src/EchoHub.slnx --no-restore --configuration Release
|
||||
|
||||
- name: Test
|
||||
run: dotnet test src/EchoHub.slnx --no-build --configuration Release --verbosity normal
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
needs: [lint-markdown, detect-changes, test]
|
||||
if: needs.detect-changes.outputs.src_changed == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Read version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(grep -oP '(?<=<Version>)[^<]+' src/Directory.Build.props)
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Check if release exists
|
||||
id: check_release
|
||||
run: |
|
||||
if gh release view "${{ steps.version.outputs.tag }}" &>/dev/null; then
|
||||
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish Server win-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r win-x64 --self-contained true -o publish/server-win-x64
|
||||
|
||||
- name: Publish Server linux-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r linux-x64 --self-contained true -o publish/server-linux-x64
|
||||
|
||||
- name: Publish Server osx-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-x64 --self-contained true -o publish/server-osx-x64
|
||||
|
||||
- name: Publish Server osx-arm64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-arm64 --self-contained true -o publish/server-osx-arm64
|
||||
|
||||
- name: Publish Client win-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r win-x64 --self-contained true -o publish/client-win-x64
|
||||
|
||||
- name: Publish Client linux-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r linux-x64 --self-contained true -o publish/client-linux-x64
|
||||
|
||||
- name: Publish Client osx-x64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-x64 --self-contained true -o publish/client-osx-x64
|
||||
|
||||
- name: Publish Client osx-arm64
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-arm64 --self-contained true -o publish/client-osx-arm64
|
||||
|
||||
- name: Zip artifacts
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: |
|
||||
cd publish
|
||||
zip -r ../EchoHub-Server-win-x64.zip server-win-x64/
|
||||
zip -r ../EchoHub-Server-linux-x64.zip server-linux-x64/
|
||||
zip -r ../EchoHub-Server-osx-x64.zip server-osx-x64/
|
||||
zip -r ../EchoHub-Server-osx-arm64.zip server-osx-arm64/
|
||||
zip -r ../EchoHub-Client-win-x64.zip client-win-x64/
|
||||
zip -r ../EchoHub-Client-linux-x64.zip client-linux-x64/
|
||||
zip -r ../EchoHub-Client-osx-x64.zip client-osx-x64/
|
||||
zip -r ../EchoHub-Client-osx-arm64.zip client-osx-arm64/
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: steps.check_release.outputs.exists == 'false'
|
||||
run: |
|
||||
gh release create "${{ steps.version.outputs.tag }}" \
|
||||
--title "EchoHub ${{ steps.version.outputs.tag }}" \
|
||||
--generate-notes \
|
||||
EchoHub-Server-win-x64.zip \
|
||||
EchoHub-Server-linux-x64.zip \
|
||||
EchoHub-Server-osx-x64.zip \
|
||||
EchoHub-Server-osx-arm64.zip \
|
||||
EchoHub-Client-win-x64.zip \
|
||||
EchoHub-Client-linux-x64.zip \
|
||||
EchoHub-Client-osx-x64.zip \
|
||||
EchoHub-Client-osx-arm64.zip
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
+46
-46
@@ -1,46 +1,46 @@
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'src/**'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
name: Build & Deploy Docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore .NET tools
|
||||
run: dotnet tool restore
|
||||
|
||||
- name: Build solution
|
||||
run: dotnet build src/EchoHub.slnx --configuration Release
|
||||
|
||||
- name: Generate documentation
|
||||
run: dotnet docfx docs/docfx.json
|
||||
|
||||
- name: Deploy to web branch
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs/_site
|
||||
publish_branch: web
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'src/**'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
name: Build & Deploy Docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore .NET tools
|
||||
run: dotnet tool restore
|
||||
|
||||
- name: Build solution
|
||||
run: dotnet build src/EchoHub.slnx --configuration Release
|
||||
|
||||
- name: Generate documentation
|
||||
run: dotnet docfx docs/docfx.json
|
||||
|
||||
- name: Deploy to web branch
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs/_site
|
||||
publish_branch: web
|
||||
|
||||
@@ -1,65 +1,65 @@
|
||||
name: PR Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
lint-markdown:
|
||||
name: Markdown Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run markdownlint
|
||||
run: bash scripts/lint-markdown.sh
|
||||
|
||||
test:
|
||||
name: Build & Test
|
||||
needs: lint-markdown
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check for src/ changes
|
||||
id: changes
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git fetch origin "$BASE_REF" --depth=1
|
||||
CHANGED=$(git diff --name-only "origin/$BASE_REF"...HEAD -- 'src/' | wc -l)
|
||||
if [ "$CHANGED" -gt 0 ]; then
|
||||
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "src_changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup .NET 10
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet restore src/EchoHub.slnx
|
||||
|
||||
- name: Build
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet build src/EchoHub.slnx --no-restore --configuration Release
|
||||
|
||||
- name: Test
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet test src/EchoHub.slnx --no-build --configuration Release --verbosity normal
|
||||
|
||||
- name: Skip notice
|
||||
if: steps.changes.outputs.src_changed == 'false'
|
||||
run: echo "No changes in src/ — skipping build and test"
|
||||
name: PR Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
lint-markdown:
|
||||
name: Markdown Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run markdownlint
|
||||
run: bash scripts/lint-markdown.sh
|
||||
|
||||
test:
|
||||
name: Build & Test
|
||||
needs: lint-markdown
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check for src/ changes
|
||||
id: changes
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git fetch origin "$BASE_REF" --depth=1
|
||||
CHANGED=$(git diff --name-only "origin/$BASE_REF"...HEAD -- 'src/' | wc -l)
|
||||
if [ "$CHANGED" -gt 0 ]; then
|
||||
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "src_changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup .NET 10
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet restore src/EchoHub.slnx
|
||||
|
||||
- name: Build
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet build src/EchoHub.slnx --no-restore --configuration Release
|
||||
|
||||
- name: Test
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet test src/EchoHub.slnx --no-build --configuration Release --verbosity normal
|
||||
|
||||
- name: Skip notice
|
||||
if: steps.changes.outputs.src_changed == 'false'
|
||||
run: echo "No changes in src/ — skipping build and test"
|
||||
|
||||
Reference in New Issue
Block a user