Skip to content

Commit 3a21b59

Browse files
committed
📝 align documentation with refactoring
1 parent 62e2624 commit 3a21b59

File tree

1 file changed

+30
-237
lines changed

1 file changed

+30
-237
lines changed

README.md

Lines changed: 30 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .NET Build
1+
# .NET Build from Codebelt
22

33
Uses the .NET CLI `dotnet build` [command](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build) that builds specified projects or the solution itself including all of its dependencies.
44

@@ -20,7 +20,7 @@ Supports `projects` input we learned to appreciate from [AzDO DotNetCoreCLI](htt
2020
To use this action in your GitHub repository, you can follow these steps:
2121

2222
```yaml
23-
uses: codebeltnet/dotnet-build@v1
23+
uses: codebeltnet/dotnet-build@v4
2424
```
2525
2626
### Inputs
@@ -31,34 +31,32 @@ with:
3131
# Supports globbing. Default is an empty string.
3232
projects: ''
3333
# Defines the build configuration.
34-
configuration: 'Release'
34+
configuration: 'Debug'
3535
# Compiles for a specific framework. The framework must be defined in the project file. Default is an empty string.
3636
framework: ''
3737
# Sets the verbosity level of the command.
3838
# Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
3939
# The default is quiet.
40-
level: 'quiet'
40+
verbosity-level: 'quiet'
4141
# Provides a way to fully customize the build. See https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches for more information.
42-
buildSwitches: ''
43-
# Upload the generated build artifact.
44-
uploadBuildArtifact: 'true'
45-
# When set, current workspace will be overwritten with the content of the restore cache.
46-
restoreCacheKey: ''
47-
# The name of the uploaded build artifact. Default, when left empty, is 'format('{0}-{1}', inputs.framework, inputs.configuration)'.
48-
uploadBuildArtifactName: ''
42+
build-switches: ''
4943
```
5044
5145
### Outputs
5246
5347
This action has no outputs.
5448
49+
### Reusable Workflow
50+
51+
A complementary [jobs-dotnet-build](https://github.com/codebeltnet/jobs-dotnet-build) reusable workflow is available, allowing you to fully leverage the Codebelt experience in your GitHub Actions pipeline.
52+
5553
## Examples
5654
5755
### Build for Release in src folder and upload build artifact
5856
5957
```yaml
6058
- name: Build for Release
61-
uses: codebeltnet/dotnet-build@v1
59+
uses: codebeltnet/dotnet-build@v4
6260
with:
6361
configuration: Release
6462
```
@@ -67,247 +65,42 @@ This action has no outputs.
6765
6866
```yaml
6967
- name: Build for Debug
70-
uses: codebeltnet/dotnet-build@v1
68+
uses: codebeltnet/dotnet-build@v4
7169
with:
7270
configuration: Debug
73-
uploadBuildArtifact: false
7471
```
7572
76-
### Time-consuming Builds for large projects
77-
78-
```yaml
79-
- name: Build
80-
uses: codebeltnet/dotnet-build@v2
81-
with:
82-
configuration: Debug
83-
restoreCacheKey: dotnet-restore-sha256
84-
```
85-
86-
### Sample workflow for .NET Class Library
87-
88-
```yaml
89-
name: Generic CI/CD Pipeline (.NET Library)
90-
on:
91-
push:
92-
branches: [main]
93-
paths-ignore:
94-
- .codecov
95-
- .docfx
96-
- .github
97-
- .nuget
98-
pull_request:
99-
branches: [main]
100-
workflow_dispatch:
101-
inputs:
102-
configuration:
103-
type: choice
104-
description: The build configuration to use in the deploy stage.
105-
required: true
106-
default: Release
107-
options:
108-
- Debug
109-
- Release
110-
111-
jobs:
112-
build:
113-
name: 🛠️ Build
114-
runs-on: ubuntu-22.04
115-
outputs:
116-
version: ${{ steps.minver-calculate.outputs.version }}
117-
steps:
118-
- name: Checkout
119-
uses: codebeltnet/git-checkout@v1
120-
121-
- name: Install .NET
122-
uses: codebeltnet/install-dotnet@v1
123-
124-
- name: Install MinVer
125-
uses: codebeltnet/dotnet-tool-install-minver@v1
126-
127-
- id: minver-calculate
128-
name: Calculate Version
129-
uses: codebeltnet/minver-calculate@v1
130-
131-
- name: Download strongname.snk file
132-
uses: codebeltnet/gcp-download-file@v1
133-
with:
134-
serviceAccountKey: ${{ secrets.GCP_TOKEN }}
135-
bucketName: ${{ secrets.GCP_BUCKETNAME }}
136-
objectName: strongname.snk
137-
138-
- name: Restore Dependencies
139-
uses: codebeltnet/dotnet-restore@v1
140-
141-
- name: Build for Preview
142-
uses: codebeltnet/dotnet-build@v1
143-
with:
144-
configuration: Debug
145-
146-
- name: Build for Production
147-
uses: codebeltnet/dotnet-build@v1
148-
with:
149-
configuration: Release
73+
## Caller workflows to showcase the Codebelt experience
15074
151-
pack:
152-
name: 📦 Pack
153-
runs-on: ubuntu-22.04
154-
strategy:
155-
matrix:
156-
configuration: [Debug, Release]
157-
needs: [build]
158-
steps:
159-
- name: Pack for ${{ matrix.configuration }}
160-
uses: codebeltnet/dotnet-pack@v1
161-
with:
162-
configuration: ${{ matrix.configuration }}
163-
uploadPackedArtifact: true
164-
version: ${{ needs.build.outputs.version }}
75+
### Basic CI/CD Pipeline
16576
166-
test:
167-
name: 🧪 Test
168-
needs: [build]
169-
strategy:
170-
matrix:
171-
os: [ubuntu-22.04, windows-2022]
172-
runs-on: ${{ matrix.os }}
173-
steps:
174-
- name: Checkout
175-
uses: codebeltnet/git-checkout@v1
77+
- Bootstrapper API - https://github.com/codebeltnet/bootstrapper/blob/main/.github/workflows/pipelines.yml
78+
- Extensions for Asp.Versioning API - https://github.com/codebeltnet/asp-versioning/blob/main/.github/workflows/pipelines.yml
79+
- Extensions for AWS Signature Version 4 API - https://github.com/codebeltnet/aws-signature-v4/blob/main/.github/workflows/pipelines.yml
80+
- Extensions for Globalization API - https://github.com/codebeltnet/globalization/blob/main/.github/workflows/pipelines.yml
81+
- Extensions for Newtonsoft.Json API - https://github.com/codebeltnet/newtonsoft-json/blob/main/.github/workflows/pipelines.yml
82+
- Extensions for Swashbuckle.AspNetCore API - https://github.com/codebeltnet/swashbuckle-aspnetcore/blob/main/.github/workflows/pipelines.yml
83+
- Extensions for xUnit API - https://github.com/codebeltnet/xunit/blob/main/.github/workflows/pipelines.yml
84+
- Extensions for YamlDotNet API - https://github.com/codebeltnet/yamldotnet/blob/main/.github/workflows/pipelines.yml
85+
- Shared Kernel API - https://github.com/codebeltnet/shared-kernel/blob/main/.github/workflows/pipelines.yml
86+
- Unitify API - https://github.com/codebeltnet/unitify/blob/main/.github/workflows/pipelines.yml
17687
177-
- name: Install .NET
178-
uses: codebeltnet/install-dotnet@v1
88+
### Intermediate CI/CD Pipeline
17989
180-
- name: Install .NET Tool - Report Generator
181-
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
90+
- Savvy I/O - https://github.com/codebeltnet/savvyio/blob/main/.github/workflows/pipelines.yml
18291
183-
- name: Test with Debug build
184-
uses: codebeltnet/dotnet-test@v1
185-
with:
186-
configuration: Debug
187-
buildSwitches: -p:SkipSignAssembly=true
92+
### Advanced CI/CD Pipeline
18893
189-
- name: Test with Release build
190-
uses: codebeltnet/dotnet-test@v1
191-
with:
192-
configuration: Release
193-
buildSwitches: -p:SkipSignAssembly=true
194-
195-
sonarcloud:
196-
name: 🔬 Code Quality Analysis
197-
needs: [build,test]
198-
runs-on: ubuntu-22.04
199-
steps:
200-
- name: Checkout
201-
uses: codebeltnet/git-checkout@v1
202-
203-
- name: Install .NET
204-
uses: codebeltnet/install-dotnet@v1
205-
206-
- name: Install .NET Tool - Sonar Scanner
207-
uses: codebeltnet/dotnet-tool-install-sonarscanner@v1
208-
209-
- name: Restore Dependencies
210-
uses: codebeltnet/dotnet-restore@v1
211-
212-
- name: Run SonarCloud Analysis
213-
uses: codebeltnet/sonarcloud-scan@v1
214-
with:
215-
token: ${{ secrets.SONAR_TOKEN }}
216-
organization: your-sonarcloud-organization
217-
projectKey: your-sonarcloud-project-key
218-
version: ${{ needs.build.outputs.version }}
219-
220-
- name: Build
221-
uses: codebeltnet/dotnet-build@v1
222-
with:
223-
buildSwitches: -p:SkipSignAssembly=true
224-
uploadBuildArtifact: false
225-
226-
- name: Finalize SonarCloud Analysis
227-
uses: codebeltnet/sonarcloud-scan-finalize@v1
228-
with:
229-
token: ${{ secrets.SONAR_TOKEN }}
230-
231-
codecov:
232-
name: 📊 Code Coverage Analysis
233-
needs: [build,test]
234-
runs-on: ubuntu-22.04
235-
steps:
236-
- name: Checkout
237-
uses: codebeltnet/git-checkout@v1
238-
239-
- name: Run CodeCov Analysis
240-
uses: codebeltnet/codecov-scan@v1
241-
with:
242-
token: ${{ secrets.CODECOV_TOKEN }}
243-
repository: your-github-repository
244-
245-
codeql:
246-
name: 🛡️ Security Analysis
247-
needs: [build,test]
248-
runs-on: ubuntu-22.04
249-
steps:
250-
- name: Checkout
251-
uses: codebeltnet/git-checkout@v1
252-
253-
- name: Install .NET
254-
uses: codebeltnet/install-dotnet@v1
255-
256-
- name: Restore Dependencies
257-
uses: codebeltnet/dotnet-restore@v1
258-
259-
- name: Prepare CodeQL SAST Analysis
260-
uses: codebeltnet/codeql-scan@v1
261-
262-
- name: Build
263-
uses: codebeltnet/dotnet-build@v1
264-
with:
265-
buildSwitches: -p:SkipSignAssembly=true
266-
uploadBuildArtifact: false
267-
268-
- name: Finalize CodeQL SAST Analysis
269-
uses: codebeltnet/codeql-scan-finalize@v1
270-
271-
deploy:
272-
name: 🚀 Deploy v${{ needs.build.outputs.version }}
273-
runs-on: ubuntu-22.04
274-
needs: [build,pack,test,sonarcloud,codecov,codeql]
275-
environment: Production
276-
steps:
277-
- uses: codebeltnet/nuget-push@v1
278-
with:
279-
token: ${{ secrets.NUGET_TOKEN }}
280-
configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }}
281-
282-
```
94+
- Cuemon for .NET - https://github.com/gimlichael/Cuemon/blob/main/.github/workflows/pipelines.yml
28395
28496
## Contributing to .NET Build
28597
28698
Contributions are welcome!
28799
Feel free to submit issues, feature requests, or pull requests to help improve this action.
288100
289-
### License
101+
## License
290102
291103
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
292104
293-
### Other Actions
294-
295-
:bookmark: [Analyze with Codecov](https://github.com/codebeltnet/codecov-scan)\
296-
:bookmark: [Analyze with CodeQL](https://github.com/codebeltnet/codeql-scan)\
297-
:bookmark: [Finalyze with CodeQL](https://github.com/codebeltnet/codeql-scan-finalize)\
298-
:bookmark: [Docker Compose](https://github.com/codebeltnet/docker-compose)\
299-
:bookmark: [.NET Build](https://github.com/codebeltnet/dotnet-build)\
300-
:bookmark: [.NET Pack](https://github.com/codebeltnet/dotnet-pack)\
301-
:bookmark: [.NET Restore](https://github.com/codebeltnet/dotnet-restore)\
302-
:bookmark: [.NET Test](https://github.com/codebeltnet/dotnet-test)\
303-
:bookmark: [Install .NET SDK](https://github.com/codebeltnet/install-dotnet)\
304-
:bookmark: [Install .NET Tool - MinVer](https://github.com/codebeltnet/dotnet-tool-install-minver)\
305-
:bookmark: [Install .NET Tool - Report Generator](https://github.com/codebeltnet/dotnet-tool-install-reportgenerator)\
306-
:bookmark: [Install .NET Tool - Sonar Scanner](https://github.com/codebeltnet/dotnet-tool-install-sonarscanner)\
307-
:bookmark: [GCP Download File](https://github.com/codebeltnet/gcp-download-file)\
308-
:bookmark: [Git Checkout](https://github.com/codebeltnet/git-checkout)\
309-
:bookmark: [MinVer Calculate](https://github.com/codebeltnet/minver-calculate)\
310-
:bookmark: [NuGet Push](https://github.com/codebeltnet/nuget-push)\
311-
:bookmark: [Shell Globbing](https://github.com/codebeltnet/shell-globbing)\
312-
:bookmark: [Analyze with SonarCloud](https://github.com/codebeltnet/sonarcloud-scan)\
313-
:bookmark: [Finalyze with SonarCloud](https://github.com/codebeltnet/sonarcloud-scan-finalize)
105+
> [!TIP]
106+
> To learn more about the Codebelt experience and offerings, visit our [organization page](https://github.com/codebeltnet) on GitHub.

0 commit comments

Comments
 (0)