A comprehensive collection of reusable GitHub Actions for .NET development, documentation generation, versioning, and CI/CD automation.
- π’ Smart Versioning - Semantic version calculation based on Git tags
- π·οΈ Dynamic Tagging - Automated Git tag creation and management
- π¨ Badge Generation - Custom SVG badges with shields.io integration
- π Release Automation - GitHub release creation with assets
- π Documentation - DocFX-powered static site generation
- π GitHub Pages - Automated documentation deployment
- π οΈ Tool Management - .NET global tool installation and management
- π¦ Package Publishing - NuGet package upload and feed management
- π Security - Apple certificate installation for code signing
| Action | Description | Key Features |
|---|---|---|
| π’ generate-version | Smart semantic versioning | Git tag analysis, branch-aware versioning, multiple output formats |
| π·οΈ git-tag | Git tag management | Annotated/lightweight tags, force options, validation |
| π¨ generate-badge | Custom badge creation | SVG generation, shields.io integration, multiple formats |
| π github-release | Release automation | Auto-generated notes, asset uploads, draft/prerelease support |
| Action | Description | Key Features |
|---|---|---|
| π οΈ dotnet-tool-install | .NET tool management | Global tool installation, version control, caching |
| π¦ dotnet-pack | Package creation | NuGet package building, symbol support, artifact management |
| π§ͺ dotnet-test | Test execution | Comprehensive testing, coverage, filtering, reporting |
| π dotnet-docfx-build | Documentation generation | DocFX integration, theme support, metadata injection |
| π dotnet-docfx-metadata | API documentation | Metadata extraction, XML documentation |
| π dotnet-docfx-pdf | PDF generation | Documentation export to PDF |
| π¦ dotnet-nuget-upload | Package publishing | NuGet upload, feed management |
| π§ dotnet-nuget-feed-setup | Feed configuration | Private feed setup, authentication |
| π dotnet-cyclonedx | SBOM generation | Software Bill of Materials creation |
| Action | Description | Key Features |
|---|---|---|
| π normalize-arguments | Argument normalization | Multi-line to single-line conversion, customizable separators |
| π normalize-path | Path normalization | Cross-platform paths, existence checking, absolute resolution |
| π³ debug-tree | Directory tree display | Debug directory structure, configurable depth |
| π¦ gh-sbom | GitHub SBOM generation | Repository SBOM creation, multiple formats |
| Action | Description | Key Features |
|---|---|---|
| π install-apple-certificate | Code signing setup | Apple certificate installation, keychain management |
| π― dotnet | .NET SDK actions | Multi-framework support, build automation |
This repository includes a comprehensive CI/CD pipeline (.github/workflows/ci.yml) that demonstrates the integration of multiple actions:
graph TD
A[π₯ Checkout] --> B[π’ Generate Version]
B --> C[π¦ Upload Version Artifacts]
C --> D[π¨ Generate Badge]
D --> E[οΏ½ Upload Badge Artifacts]
E --> F[π Build Documentation]
F --> G[π Move Badge to Site Assets]
G --> H[π€ Upload Pages Artifact]
H --> I[π·οΈ Create Git Tag]
I --> J[π Create Release]
J --> K[π Workflow Summary]
K --> L[π Deploy to Pages]
- π Automatic Versioning: Semantic version calculation with Git tag analysis
- π¦ Artifact Management: Version files and badges uploaded as workflow artifacts
- π¨ Badge Generation: SVG badges with automated integration into documentation
- π·οΈ Smart Tagging: Conditional tag creation based on branch rules and force-release option
- π Release Management: Automated GitHub releases with generated notes
- π Documentation: DocFX-powered site generation with integrated assets
- π Two-Stage Deployment: Separate build and deploy jobs for GitHub Pages
- π Rich Summaries: Detailed workflow summaries with status and quick links
The CI/CD pipeline consists of two main jobs:
- Version Generation: Creates semantic versions with multiple output formats
- Artifact Upload: Stores version files and badges for download
- Documentation Build: Generates DocFX-powered documentation site
- Asset Integration: Automatically includes badges in documentation
- Conditional Release: Creates tags and releases only on main branch or force-release
- Summary Generation: Provides detailed workflow execution summary
- GitHub Pages Deployment: Deploys documentation site to GitHub Pages
- Asset Verification: Ensures badges and documentation are properly deployed
- Deployment Summary: Provides links and verification of deployed resources
- Push Events: Automatically runs on
mainanddevelopbranches - Pull Requests: Validates changes targeting the
mainbranch - Manual Dispatch: Supports manual execution with version and release options
name: Example Workflow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Version
id: version
uses: laerdal/Github_Actions/generate-version@main
with:
major: '1'
minor: '0'
- name: Create Release
uses: laerdal/Github_Actions/github-release@main
with:
tag: ${{ steps.version.outputs.VERSION_FULL }}
title: 'Release ${{ steps.version.outputs.VERSION_FULL }}'
generate-notes: 'true'name: Full CI/CD Pipeline
on:
push:
branches: [ main ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Version
id: version
uses: laerdal/Github_Actions/generate-version@main
with:
major: '2'
minor: '1'
output-txt: 'version.txt'
- name: Create Git Tag
uses: laerdal/Github_Actions/git-tag@main
with:
tag: ${{ steps.version.outputs.VERSION_FULL }}
message: 'Release ${{ steps.version.outputs.VERSION_FULL }}'
- name: Generate Badge
uses: laerdal/Github_Actions/generate-badge@main
with:
label: 'version'
message: ${{ steps.version.outputs.VERSION_FULL }}
output-file: 'badge.svg'
output-format: 'svg'
- name: Build Documentation
uses: laerdal/Github_Actions/dotnet-docfx-build@main
with:
metadata: '{"_appTitle":"My Project"}'
- name: Create Release
uses: laerdal/Github_Actions/github-release@main
with:
tag: ${{ steps.version.outputs.VERSION_FULL }}
assets: |
version.txt
badge.svg
_site/**/*Complete documentation is available at: https://laerdal.github.io/Github_Actions/
Each action includes comprehensive documentation:
- π README.md - Detailed usage instructions
- π§ action.yml - Input/output specifications
- π‘ Examples - Real-world usage scenarios
- π οΈ Troubleshooting - Common issues and solutions
All actions follow consistent design patterns:
- β Validation - Comprehensive input validation
- βοΈ Execution - Main functionality with error handling
- π Summary - Detailed output summaries
- π Input Validation - All inputs validated upfront
- π€ Rich Outputs - Multiple output formats for flexibility
- π‘οΈ Error Handling - Graceful failure with actionable messages
- π Summaries - Optional detailed execution summaries
- π¨ Consistent Styling - Emoji-based naming and clear descriptions
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-action - Follow the action structure principles
- Test your action thoroughly
- Submit a pull request
- Follow the established three-step pattern
- Include comprehensive input validation
- Provide detailed documentation
- Add usage examples
- Ensure cross-platform compatibility
This project is licensed under the MIT License - see the LICENSE.md file for details.
- GitHub Actions team for the excellent platform
- DocFX team for documentation tooling
- shields.io for badge generation services
- The open-source community for inspiration and feedback
β Star this repository if you find it useful!
π Documentation β’ π Report Bug β’ π‘ Request Feature