Skip to content

codebeltnet/jobs-dotnet-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reusable Workflows for .NET CLI Build

This repository contains reusable workflows for interacting with .NET CLI build command in your CI/CD pipeline.

These workflows is part of the Codebelt umbrella and ensures a consistent way of:

  • Defining your CI/CD pipeline
  • Structuring your repository
  • Keeping your codebase small and feasible
  • Writing clean and maintainable code
  • Deploying your code to different environments
  • Automating as much as possible

A paved path to excel as a DevSecOps Engineer.

Available Workflows

Usage

To call this workflow in your GitHub repository, you can follow these steps:

build-call:
    uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v2

Inputs

with:
  # Path to the project(s) file to build. Pass empty to have MSBuild use the default behavior. Supports globbing.  Default is an empty string.
  projects: ''
  # Defines the build configuration. Default is Debug.
  configuration: 'Debug'
  # Compiles for a specific framework. The framework must be defined in the project file. Default is an empty string.
  framework: ''
  # When set to true, includes preview versions of .NET. Default is false.
  include-preview: false
  # The filename of the strong name key. Default is an empty string.
  strong-name-key-filename: ''
  # Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed, and diagnostic. Default is quiet.
  verbosity-level: 'quiet'
  # Provides a way to fully customize the build. Default is empty. See https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches for more information.
  build-switches: ''
  # Upload the generated build artifact. Default is to upload.
  upload-build-artifact: true
  # The name of the uploaded build artifact. Default, when left empty, is 'format('{0}-{1}', inputs.framework, inputs.configuration)'.
  upload-build-artifact-name: ''
  # When set, the current workspace will be overwritten with the content of the restore cache. Default is an empty string.
  restore-cache-key: ''
  # The maximum time in minutes to allow the job to run. Default is 15 minutes.
  timeout-minutes: 15

Secrets

secrets:
  GCP_TOKEN: ${{ secrets.GCP_TOKEN }}
  GCP_BUCKETNAME: ${{ secrets.GCP_BUCKETNAME }}

Outputs

outputs:
  # The calculated version in SEMVER format.
  version: X.Y.Z # where X is MAJOR, Y is MINOR and Z is PATCH

Examples

# Sign the assembly with a strong name key
jobs:
  build:
    uses: codebeltnet/jobs-dotnet-build/.github/workflows/default@v2
    with:
      strong-name-key-filename: 'my-key.snk'
    secrets: inherit

# Time-consuming builds for large projects
- name: Build
  uses: codebeltnet/dotnet-build@v4
  with:
    restore-cache-key: dotnet-restore-sha256

Caller workflows to showcase the Codebelt experience

Basic CI/CD Pipeline

Intermediate CI/CD Pipeline

Advanced CI/CD Pipeline

Contributing to Reusable Workflows for .NET CLI Build

Contributions are welcome! Feel free to submit issues, feature requests, or pull requests to help improve these workflows.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A reusable workflow for the .NET CLI `build` command.

Resources

License

Stars

Watchers

Forks