|
| 1 | +# GitHub Actions Workflows |
| 2 | + |
| 3 | +This directory contains GitHub Actions workflows for CI/CD and package publishing. |
| 4 | + |
| 5 | +## Workflows |
| 6 | + |
| 7 | +### CI (`ci.yml`) |
| 8 | +Runs on every push and pull request to main/master/develop branches. |
| 9 | + |
| 10 | +**Features:** |
| 11 | +- Builds the project |
| 12 | +- Runs all tests |
| 13 | +- Uploads test results and coverage reports |
| 14 | +- Uses Codecov for coverage reporting |
| 15 | + |
| 16 | +### Pull Request (`pr.yml`) |
| 17 | +Runs on pull requests to main/master/develop branches. |
| 18 | + |
| 19 | +**Features:** |
| 20 | +- Cross-platform testing (Ubuntu, Windows, macOS) |
| 21 | +- Build verification |
| 22 | +- Test execution |
| 23 | +- Code formatting verification |
| 24 | + |
| 25 | +### Release (`release.yml`) |
| 26 | +Publishes NuGet packages when: |
| 27 | +- A tag matching `v*.*.*` is pushed (e.g., `v3.0.0`) |
| 28 | +- Manual workflow dispatch with version input |
| 29 | + |
| 30 | +**Features:** |
| 31 | +- Builds and tests the project |
| 32 | +- Creates NuGet package |
| 33 | +- Publishes to NuGet.org |
| 34 | +- Uploads artifacts |
| 35 | + |
| 36 | +**Required Secrets:** |
| 37 | +- `NUGET_API_KEY` - Your NuGet.org API key |
| 38 | + |
| 39 | +### CodeQL Analysis (`codeql.yml`) |
| 40 | +Security analysis using GitHub's CodeQL. |
| 41 | + |
| 42 | +**Features:** |
| 43 | +- Automated security scanning |
| 44 | +- Runs on pushes, PRs, and weekly schedule |
| 45 | +- C# code analysis |
| 46 | + |
| 47 | +## Setting Up NuGet Publishing |
| 48 | + |
| 49 | +1. Get your NuGet API key from https://www.nuget.org/account/apikeys |
| 50 | +2. Add it as a secret in your GitHub repository: |
| 51 | + - Go to Settings → Secrets and variables → Actions |
| 52 | + - Click "New repository secret" |
| 53 | + - Name: `NUGET_API_KEY` |
| 54 | + - Value: Your NuGet API key |
| 55 | +3. Create a release tag: |
| 56 | + ```bash |
| 57 | + git tag v3.0.0 |
| 58 | + git push origin v3.0.0 |
| 59 | + ``` |
| 60 | + Or use the workflow dispatch feature in the Actions tab. |
| 61 | + |
| 62 | +## Dependabot |
| 63 | + |
| 64 | +Dependabot is configured to automatically update: |
| 65 | +- NuGet packages (weekly) |
| 66 | +- GitHub Actions (weekly) |
| 67 | + |
| 68 | +See `.github/dependabot.yml` for configuration. |
0 commit comments