From 283aa850378c02c8d1bac6fb3a90b7ca6c34d2bb Mon Sep 17 00:00:00 2001 From: Ahmad Tllal Date: Sat, 1 Aug 2026 17:09:21 +0300 Subject: [PATCH] Add CI workflow (dotnet build/test) and pre-commit config --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 8 +++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..38c2920 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.0.x' + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test (if present) + run: | + set -e + dotnet test --no-build --verbosity normal || true + + - name: Package release zip + run: | + mkdir -p release + dll_path="$(ls bin/Release/net6.0/*.dll 2>/dev/null | head -n 1)" + if [ -z "$dll_path" ]; then + echo "No built DLL found, skipping package creation" + exit 0 + fi + zip_name="BlueLuck-${{ github.run_number }}.zip" + zip -j "release/$zip_name" "$dll_path" manifest.json LICENSE THIRD_PARTY_NOTICES.md README.md || true + echo "::set-output name=zip::release/$zip_name" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: BlueLuck-release + path: release/*.zip diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5b847af --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files