Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
added github workflow as template
Browse files Browse the repository at this point in the history
  • Loading branch information
kurmann committed Mar 31, 2024
1 parent 2f305ac commit aa735ce
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
35 changes: 35 additions & 0 deletions templates/nugetworkflow/.github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: .NET CI/CD

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build_and_pack:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore dependencies for Module
run: dotnet restore src/Module/Module.csproj

# Optional: Ausführen der Tests
# - name: Test
# run: dotnet test src/Tests/Tests.csproj --no-build --verbosity normal

- name: Pack Module
run: dotnet pack src/Module/Module.csproj --output ./nupkgs

# Veröffentlichen der NuGet-Pakete
- name: Push NuGet and Symbol Packages
run: |
dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push ./nupkgs/*.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
38 changes: 38 additions & 0 deletions templates/nugetworkflow/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Patrick Kurmann",
"classifications": [
"Common",
"GitHub Actions"
],
"identity": "Kurmann.AutomateVideoPublishing.ServiceCollectionIntegratedModule.NuGetWorkflow",
"name": "Service Collection Integrated Module NuGet Workflow",
"shortName": "nugetworkflow",
"sourceName": "ServiceCollectionIntegratedModule.NuGetWorkflow",
"description": "Creates a GitHub Actions workflow for publishing a Service Collection Integrated Module to NuGet.org.",
"tags": {
"language": "YAML",
"type": "item"
},
"preferNameDirectory": true,
"sources": [
{
"modifiers": [
{
"exclude": [
".vs/**",
".template_config/**",
"**/bin/**",
"**/obj/**",
"/bin/**",
"/obj/**",
".git/**",
"Readme.md",
"LICENSE",
"nuget.csproj"
]
}
]
}
]
}

0 comments on commit aa735ce

Please sign in to comment.