|
| 1 | +# Binding Simple CD - Template |
| 2 | + |
| 3 | +# This template is for pure .NET bindings (no XML update) to publish NuGets to Nuget.org. |
| 4 | +# Copy this file to your repository as `.github/workflows/CD.yml` and customize the inputs below. |
| 5 | + |
1 | 6 | name: CD |
| 7 | + |
2 | 8 | on: |
3 | 9 | workflow_dispatch: |
4 | | - inputs: |
5 | | - publishEnabled: |
6 | | - description: "Publish to Nuget.org" |
7 | | - type: boolean |
8 | | - required: false |
9 | | - default: false |
10 | | - |
11 | | -env: |
12 | | - nugetOutputPath: ${{ 'nupkgs' }} |
13 | 10 |
|
14 | 11 | jobs: |
15 | | - build_and_publish: |
16 | | - runs-on: windows-latest |
17 | | - steps: |
18 | | - - uses: actions/checkout@v4 |
19 | | - - uses: actions/setup-dotnet@v4 |
20 | | - with: |
21 | | - dotnet-version: 8.x |
22 | | - - uses: nuget/setup-nuget@v2 |
23 | | - with: |
24 | | - nuget-version: "6.x" |
25 | | - - name: Generate Bindings |
26 | | - id: build_bindings |
27 | | - run: powershell ./Generate-Bindings.ps1 |
28 | | - - name: Generate NuGet packages |
29 | | - id: build_nugets |
30 | | - run: powershell ./Generate-NuGets.ps1 -revision ${{ github.run_number }} -outputfolder ${{ env.nugetOutputPath }} |
31 | | - - name: Publish NuGet |
32 | | - if: ${{ success() && github.event.inputs.publishEnabled == 'true' }} |
33 | | - env: |
34 | | - token: ${{secrets.EVERGINE_NUGETORG_TOKEN}} |
35 | | - run: | |
36 | | - cd ${{ env.nugetOutputPath }} |
37 | | - ls *.nupkg |
38 | | - dotnet nuget push "**/*.nupkg" --skip-duplicate --no-symbols -k "$env:token" -s https://api.nuget.org/v3/index.json |
39 | | - - name: SendGrid Mail Action |
40 | | - if: ${{ failure() }} |
41 | | - uses: mmichailidis/sendgrid-mail-action@v1.1 |
42 | | - with: |
43 | | - # The token for sendgrid |
44 | | - sendgrid-token: ${{ secrets.WAVE_SENDGRID_TOKEN }} |
45 | | - # List of emails separated by comma that the email will go |
46 | | - mail: ${{ secrets.EVERGINE_EMAILREPORT_LIST }} |
47 | | - # The email that will be shown as sender |
48 | | - from: ${{ secrets.EVERGINE_EMAIL }} |
49 | | - # The subject of the email |
50 | | - subject: RenderDoc Update NuGet has failed |
51 | | - # Defines if it should be one email with multiple address or multiple emails with a single address |
52 | | - individual: false |
53 | | - # The body of the mail. The placeholders that can be used are $EVENT$, $ISSUE$, $ACTION$ |
54 | | - text: something went wrong when building RenderDoc |
| 12 | + cd: |
| 13 | + if: github.event_name != 'schedule' || github.ref == 'refs/heads/master' |
| 14 | + uses: EvergineTeam/evergine-standards/.github/workflows/binding-simple-cd.yml@main |
| 15 | + with: |
| 16 | + generator-project: "RenderDocGen/RenderDocGen/RenderDocGen.csproj" # Path to your generator .csproj |
| 17 | + generator-name: "RenderDoc" # Name of your generator executable |
| 18 | + binding-project: "RenderDocGen/Evergine.Bindings.RenderDoc/Evergine.Bindings.RenderDoc.csproj" # Path to your binding .csproj |
| 19 | + target-framework: "net8.0" # Target framework for generator/binding |
| 20 | + dotnet-version: "8.x" # .NET SDK version |
| 21 | + nuget-version: "6.x" # NuGet CLI version |
| 22 | + runtime-identifier: "win-x64" # Runtime identifier (win-x64, linux-x64, etc.) |
| 23 | + build-configuration: "Release" # Build configuration (Release, Debug, etc.) |
| 24 | + revision: ${{ github.run_number }} # Revision for date-based version (bindings style). Use with bindings. |
| 25 | + publish-enabled: true # Publish NuGets to Nuget.org |
| 26 | + enable-email-notifications: true # Enable email notifications on failure |
| 27 | + secrets: |
| 28 | + NUGET_UPLOAD_TOKEN: ${{ secrets.EVERGINE_NUGETORG_TOKEN }} |
| 29 | + WAVE_SENDGRID_TOKEN: ${{ secrets.WAVE_SENDGRID_TOKEN }} |
| 30 | + EVERGINE_EMAILREPORT_LIST: ${{ secrets.EVERGINE_EMAILREPORT_LIST }} |
| 31 | + EVERGINE_EMAIL: ${{ secrets.EVERGINE_EMAIL }} |
| 32 | + |
| 33 | +# Tips: |
| 34 | +# - For direct version (add-ons style): |
| 35 | +# version: "3.4.22.288-local" |
| 36 | +# - For date-based version (bindings style): |
| 37 | +# revision: "" # Uses github.run_number or custom logic |
0 commit comments