diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..39c6b58b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,34 @@ +--- +name: Bug Report +about: Report a bug in OwnCord +title: "bug: " +labels: bug +--- + +## Description + + + +## Steps to Reproduce + +1. +2. +3. + +## Expected Behavior + + + +## Actual Behavior + + + +## Environment + +- **OS**: Windows 11 (version) +- **OwnCord Version**: +- **Component**: Server / Client / Both + +## Screenshots / Logs + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..f415b94c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature Request +about: Suggest a new feature for OwnCord +title: "feat: " +labels: enhancement +--- + +## Problem + + + +## Proposed Solution + + + +## Alternatives Considered + + + +## Additional Context + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..c4bb1000 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ +# Pull Request + +## Summary + + + +- + +## Changes + + + +- + +## Test Plan + +- [ ] Unit tests pass (`npm test` / `go test ./...`) +- [ ] TypeScript check passes (`npx tsc --noEmit`) +- [ ] Manual testing done (describe below) + +## Screenshots + + + +## Related Issues + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ebc11c4b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,54 @@ +version: 2 + +updates: + # Go server dependencies + - package-ecosystem: gomod + directory: /Server + schedule: + interval: weekly + day: monday + commit-message: + prefix: "chore(deps):" + labels: + - dependencies + - go + open-pull-requests-limit: 10 + + # Tauri client npm dependencies + - package-ecosystem: npm + directory: /Client/tauri-client + schedule: + interval: weekly + day: monday + commit-message: + prefix: "chore(deps):" + labels: + - dependencies + - npm + open-pull-requests-limit: 10 + + # Tauri Rust/Cargo dependencies + - package-ecosystem: cargo + directory: /Client/tauri-client/src-tauri + schedule: + interval: weekly + day: monday + commit-message: + prefix: "chore(deps):" + labels: + - dependencies + - rust + open-pull-requests-limit: 5 + + # GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + day: monday + commit-message: + prefix: "ci(deps):" + labels: + - dependencies + - ci + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28b5461f..a2289fec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,15 +2,14 @@ name: CI on: push: - branches: - - main - - dev - - tauri-migration - - "feature/*" + branches: [main] pull_request: - branches: - - main - - dev + branches: [main, dev] + +# Cancel in-progress runs for the same branch/PR +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true jobs: server-build-test: @@ -30,31 +29,58 @@ jobs: run: go build -o chatserver.exe -ldflags "-s -w" . - name: Run tests with coverage - run: go test ./... -cover + run: go test ./... -coverprofile=coverage.out -cover + + - name: Upload Go coverage + if: always() + uses: actions/upload-artifact@v4 + with: + name: go-coverage + path: Server/coverage.out + retention-days: 7 - name: Lint uses: golangci/golangci-lint-action@v6 with: working-directory: Server/ - client-build-test: - name: Client Build & Test + client-check: + name: Client Typecheck & Test runs-on: windows-latest + defaults: + run: + working-directory: Client/tauri-client/ steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - uses: actions/setup-node@v4 with: - dotnet-version: 8.0.x + node-version: 20 + cache: npm + cache-dependency-path: Client/tauri-client/package-lock.json - - name: Build client - run: dotnet build Client/OwnCord.Client.sln + - name: Install npm dependencies + run: npm ci - - name: Run client tests - run: dotnet test Client/OwnCord.Client.Tests/ + - name: TypeScript check + run: npx tsc --noEmit - tauri-client: - name: Tauri Client Build & Test + - name: Run unit tests with coverage + run: npx vitest run --coverage --reporter=default + + - name: Upload client coverage + if: always() + uses: actions/upload-artifact@v4 + with: + name: client-coverage + path: Client/tauri-client/coverage/ + retention-days: 7 + + # Full Tauri build only on PRs to main (expensive: ~15 min x2 multiplier) + tauri-build: + name: Tauri Full Build + needs: client-check + if: github.event_name == 'pull_request' && github.base_ref == 'main' runs-on: windows-latest defaults: run: @@ -79,11 +105,5 @@ jobs: - name: Install npm dependencies run: npm ci - - name: TypeScript check - run: npx tsc --noEmit - - - name: Run unit tests - run: npm test - - name: Build Tauri app run: npm run tauri build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a379f0a..1f481581 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,9 +18,19 @@ jobs: with: go-version: "1.25" - - uses: actions/setup-dotnet@v4 + - uses: actions/setup-node@v4 with: - dotnet-version: 8.0.x + node-version: 20 + cache: npm + cache-dependency-path: Client/tauri-client/package-lock.json + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: Client/tauri-client/src-tauri - name: Extract version from tag shell: bash @@ -32,21 +42,30 @@ jobs: shell: bash run: cd Server && go build -o chatserver.exe -ldflags "-s -w -X main.version=$VERSION" . - - name: Build client single-file - run: >- - dotnet publish Client/OwnCord.Client/OwnCord.Client.csproj - -c Release -r win-x64 --self-contained - -p:PublishSingleFile=true - -p:IncludeNativeLibrariesForSelfExtract=true - -o dist/client + - name: Install npm dependencies + working-directory: Client/tauri-client + run: npm ci + + - name: Build Tauri app + working-directory: Client/tauri-client + run: npm run tauri build + + - name: Locate installer + id: installer + shell: bash + run: | + INSTALLER=$(find Client/tauri-client/src-tauri/target/release/bundle/nsis -name "*.exe" | head -1) + echo "path=$INSTALLER" >> "$GITHUB_OUTPUT" + echo "name=$(basename $INSTALLER)" >> "$GITHUB_OUTPUT" - name: Generate SHA256 checksums shell: pwsh run: | $serverHash = (Get-FileHash -Path Server/chatserver.exe -Algorithm SHA256).Hash.ToLower() - $clientHash = (Get-FileHash -Path dist/client/OwnCord.Client.exe -Algorithm SHA256).Hash.ToLower() - "$serverHash chatserver.exe" | Out-File -FilePath checksums.sha256 -Encoding utf8 -NoNewline - "`n$clientHash OwnCord.Client.exe" | Out-File -FilePath checksums.sha256 -Encoding utf8 -Append -NoNewline + $installerPath = "${{ steps.installer.outputs.path }}" + $installerName = "${{ steps.installer.outputs.name }}" + $clientHash = (Get-FileHash -Path $installerPath -Algorithm SHA256).Hash.ToLower() + "$serverHash chatserver.exe`n$clientHash $installerName" | Out-File -FilePath checksums.sha256 -Encoding utf8 -NoNewline - name: Create GitHub Release env: @@ -55,5 +74,5 @@ jobs: gh release create ${{ github.ref_name }} --generate-notes Server/chatserver.exe - dist/client/OwnCord.Client.exe + "${{ steps.installer.outputs.path }}" checksums.sha256