feat: Update CRDs #10884
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CICD | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
- 'alpha' | |
- 'beta' | |
- 'dev' | |
- 'sync-charts' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
create-release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
id: semantic | |
with: | |
dry_run: true | |
extra_plugins: | | |
@semantic-release/changelog | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Generate Models | |
shell: pwsh | |
run: | | |
$projects = Get-ChildItem -Path $PWD\src\Models -Recurse -Filter *.csproj | |
foreach($project in $projects){ | |
dotnet run -c Release --project src\KubernetesCRDModelGen.Tool\KubernetesCRDModelGen.Tool.csproj --FolderPath $($project.Directory) | |
if (-not $?) { | |
throw "CRD Generation Failed" | |
} | |
} | |
- name: .NET Build | |
run: dotnet build -c Release | |
- name: .NET Test | |
run: dotnet test -c Release --collect:"XPlat Code Coverage" | |
- name: Coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.cobertura.xml | |
fail_ci_if_error: false | |
- name: Benchmarks | |
working-directory: benchmarks/KubernetesCRDModelGen.Benchmarks | |
run: dotnet run -c Release | |
- name: .NET Pack | |
run: dotnet pack -c Release -p:Version=${{ (steps.semantic.outputs.new_release_published && steps.semantic.outputs.new_release_version) || '1.0.0' }} | |
- name: Semantic Release | |
if: steps.semantic.outputs.new_release_published == 'true' | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
extra_plugins: | | |
@semantic-release/changelog | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: .NET NuGet Push | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: dotnet nuget push src/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: NuGet Package | |
path: src/**/*.nupkg |