Skip to content

Commit f7f3728

Browse files
committed
Sync standards initialization
1 parent ce7fff4 commit f7f3728

File tree

11 files changed

+457
-201
lines changed

11 files changed

+457
-201
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,32 @@
1+
# Binding CI - Simple Template
2+
3+
# This template is for .NET bindings.
4+
# Copy this file to your repository as `.github/workflows/CI.yml` and customize the inputs below.
5+
16
name: CI
7+
28
on:
9+
workflow_dispatch:
310
push:
411
branches: [ "master" ]
512
pull_request:
613
branches: [ "master" ]
714

8-
env:
9-
nugetOutputPath: ${{ 'nupkgs' }}
10-
1115
jobs:
12-
build_and_publish:
13-
runs-on: windows-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-dotnet@v4
17-
with:
18-
dotnet-version: 8.x
19-
- uses: nuget/setup-nuget@v2
20-
with:
21-
nuget-version: "6.x"
22-
- name: Generate Bindings
23-
id: build_bindings
24-
shell: pwsh
25-
run: |
26-
./Generate-Bindings.ps1
27-
- name: Generate NuGet packages
28-
id: build_nugets
29-
shell: pwsh
30-
run: |
31-
./Generate-NuGets.ps1 -revision ${{ github.run_number }} -outputfolder ${{ env.nugetOutputPath }}
32-
- name: SendGrid Mail Action
33-
if: ${{ failure() }}
34-
uses: mmichailidis/[email protected]
35-
with:
36-
# The token for sendgrid
37-
sendgrid-token: ${{ secrets.WAVE_SENDGRID_TOKEN }}
38-
# List of emails separated by comma that the email will go
39-
mail: ${{ secrets.EVERGINE_EMAILREPORT_LIST }}
40-
# The email that will be shown as sender
41-
from: ${{ secrets.EVERGINE_EMAIL }}
42-
# The subject of the email
43-
subject: WebGPU.Net CD build has failed
44-
# Defines if it should be one email with multiple address or multiple emails with a single address
45-
individual: false
46-
# The body of the mail. The placeholders that can be used are $EVENT$, $ISSUE$, $ACTION$
47-
text: something went wrong when building WebGPU.Net
16+
ci:
17+
uses: EvergineTeam/evergine-standards/.github/workflows/binding-common-ci.yml@main
18+
with:
19+
generator-project: "WebGPUGen/WebGPUGen/WebGPUGen.csproj" # Path to your generator .csproj
20+
generator-name: "WebGPU" # Name of your generator executable
21+
binding-project: "WebGPUGen/Evergine.Bindings.WebGPU/Evergine.Bindings.WebGPU.csproj" # Path to your binding .csproj
22+
target-framework: "net8.0" # Target framework for generator/binding
23+
runtime-identifier: "win-x64" # Runtime identifier (win-x64, linux-x64, etc.)
24+
build-configuration: "Release" # Build configuration (Release, Debug, etc.)
25+
nuget-artifacts: false # Upload NuGets as workflow artifacts
26+
revision: ${{ github.run_number }} # Revision for date-based version (bindings style). Use with bindings.
27+
28+
# Tips:
29+
# - For direct version (add-ons style):
30+
# version: "3.4.22.288-local"
31+
# - For date-based version (bindings style):
32+
# revision: "" # Uses github.run_number or custom logic

.github/workflows/cd.yml

Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,37 @@
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+
16
name: CD
7+
28
on:
39
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' }}
1310

1411
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-
shell: pwsh
28-
run: |
29-
./Generate-Bindings.ps1
30-
- name: Generate NuGet packages
31-
id: build_nugets
32-
shell: pwsh
33-
run: |
34-
./Generate-NuGets.ps1 -revision ${{ github.run_number }} -outputfolder ${{ env.nugetOutputPath }} -debugSymbols false
35-
- name: Publish NuGet
36-
if: ${{ success() && github.event.inputs.publishEnabled == 'true' }}
37-
env:
38-
token: ${{secrets.EVERGINE_NUGETORG_TOKEN}}
39-
shell: pwsh
40-
run: |
41-
cd ${{ env.nugetOutputPath }}
42-
ls *.nupkg
43-
dotnet nuget push "**/*.nupkg" --skip-duplicate --no-symbols -k "$env:token" -s https://api.nuget.org/v3/index.json
44-
- name: SendGrid Mail Action
45-
if: ${{ failure() }}
46-
uses: mmichailidis/[email protected]
47-
with:
48-
# The token for sendgrid
49-
sendgrid-token: ${{ secrets.WAVE_SENDGRID_TOKEN }}
50-
# List of emails separated by comma that the email will go
51-
mail: ${{ secrets.EVERGINE_EMAILREPORT_LIST }}
52-
# The email that will be shown as sender
53-
from: ${{ secrets.EVERGINE_EMAIL }}
54-
# The subject of the email
55-
subject: WebGPU.Net CD build has failed
56-
# Defines if it should be one email with multiple address or multiple emails with a single address
57-
individual: false
58-
# The body of the mail. The placeholders that can be used are $EVENT$, $ISSUE$, $ACTION$
59-
text: something went wrong when building WebGPU.Net
12+
publish:
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: "WebGPUGen/WebGPUGen/WebGPUGen.csproj" # Path to your generator .csproj
17+
generator-name: "WebGPU" # Name of your generator executable
18+
binding-project: "WebGPUGen/Evergine.Bindings.WebGPU/Evergine.Bindings.WebGPU.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
26+
enable-email-notifications: true
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
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Sync standards
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
org:
7+
description: "Standards org"
8+
default: "EvergineTeam"
9+
required: false
10+
repo:
11+
description: "Standards repo"
12+
default: "evergine-standards"
13+
required: false
14+
ref:
15+
description: "Branch/tag/commit of standards"
16+
default: "main"
17+
required: false
18+
target_branch:
19+
description: "Target branch to apply changes"
20+
default: "main"
21+
required: false
22+
script_path:
23+
description: "Path where to download the sync script"
24+
default: "sync-standards.ps1"
25+
required: false
26+
commit_message:
27+
description: "Commit message"
28+
required: false
29+
mode:
30+
description: "auto (push then PR if needed) or pr (always PR)"
31+
default: "auto"
32+
required: false
33+
dry_run:
34+
description: "Dry run mode - show what would be done without making changes"
35+
type: boolean
36+
default: false
37+
required: false
38+
39+
schedule:
40+
- cron: "0 2 1 * *" # 02:00 UTC on the 1st of every month
41+
42+
jobs:
43+
sync:
44+
permissions:
45+
contents: write # allow push commits
46+
pull-requests: write
47+
uses: EvergineTeam/evergine-standards/.github/workflows/_sync-standards-reusable.yml@main
48+
with:
49+
org: ${{ github.event.inputs.org || 'EvergineTeam' }}
50+
repo: ${{ github.event.inputs.repo || 'evergine-standards' }}
51+
ref: ${{ github.event.inputs.ref || 'main' }}
52+
target_branch: ${{ github.event.inputs.target_branch || 'main' }}
53+
script_path: ${{ github.event.inputs.script_path || 'sync-standards.ps1' }}
54+
commit_message: "${{ github.event.inputs.commit_message || vars.STANDARDS_COMMIT_MESSAGE || 'auto: sync standard files [skip ci]' }}"
55+
mode: ${{ github.event.inputs.mode || 'auto' }}
56+
dry_run: ${{ github.event.inputs.dry_run == 'true' }}
57+
secrets: inherit

.standards.override.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"schema": "2",
3+
"groups": [
4+
"core",
5+
"binding"
6+
],
7+
"remap": {
8+
"assets/nuget-icon.png": "icon.png"
9+
}
10+
}

Generate-Bindings.ps1

Lines changed: 0 additions & 58 deletions
This file was deleted.

Generate-NuGets.ps1

Lines changed: 0 additions & 49 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Evergine
3+
Copyright (c) 2025 Evergine
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)