Skip to content

Commit 2d9944f

Browse files
authored
Add CoPilot skills (#316)
1 parent e04b381 commit 2d9944f

9 files changed

Lines changed: 749 additions & 25 deletions

File tree

.github/copilot-instructions.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ These instructions define how GitHub Copilot should assist with this project. Th
3232

3333
## File Structure
3434

35-
```txt
35+
```plaintext
3636
.azuredevops/ # Azure DevOps pipeline configuration and policy files.
3737
.github/ # GitHub Actions workflow files and linter configuration files.
3838
.nuget/ # NuGet package configuration files.
@@ -43,6 +43,7 @@ MatrixStack/ # D3DX9-like matrix stack implementation for DirectXMath.
4343
SHMath/ # Spherical harmonic functions using DirectXMath.
4444
Stereo3D/ # Stereo 3D projection matrix functions using DirectXMath created for HoloLens.
4545
XDSP/ # Digital Signal Processing (DSP) functions using DirectXMath.
46+
skills/ # Published CoPilot skills for use by developers.
4647
Tests/ # Tests are designed to be cloned from a separate repository at this location.
4748
wiki/ # Local clone of the GitHub wiki documentation repository.
4849
```
@@ -515,24 +516,4 @@ When reviewing code, focus on the following aspects:
515516

516517
## Release Process
517518

518-
1. Ensure all changes are merged into the `main` branch and that all tests pass.
519-
2. Git pull the local repository to ensure it is up to date with the `main` branch.
520-
3. Run the PowerShell script `build\preparerelease.ps1` which will generate a topic branch for the release, update the version number in `CMakeLists.txt`, the `README.md` file, the release notes in the nuspec files, and create a stub in the `CHANGELOG.md` file for the new release.
521-
4. Edit the `CHANGELOG.md` file to update it with a summary of changes.
522-
5. Submit the topic branch for review and merge into `main` once approved. Allow the GitHub Actions workflows and the Azure DevOps pipelines to complete successfully before proceeding.
523-
6. Run the PowerShell script `build\completerelease.ps1` which will set a tag on the project repo and the test repo, and create a release on GitHub with the release notes from `CHANGELOG.md`. Ensure you have set up GPG signing for your GitHub account so that the tags will be verified.
524-
7. Git pull the local repository to ensure it is up to date with the `main` branch. Be sure to include `--tags`.
525-
8. Push the `main` branch to the MSCodeHub mirror repository. Be sure to include `--tags`.
526-
9. Create a PR on MSCodeHub from the `main` branch to the `release` branch.
527-
10. Merge the PR on MSCodeHub to update the release branch, which will trigger the Azure DevOps pipeline to build the NuGet package.
528-
11. Download the GitHub source .zip archive from the release. Unzip and compare to the local repo to ensure it matches — keep in mind there may be some CR/LF differences. Run minisign on the .zip to generate a signature file, and upload the signature file to the release assets.
529-
12. Run the PowerShell script `build\promotenuget.ps1` with the `-Release` parameter to promote the version to the Release view on the project-scoped ADO feed.
530-
13. Run the MSCodeHub pipeline to publish the NuGet package to nuget.org. The pipeline will automatically push the most recent package promoted to the Release view to nuget.org.
531-
14. Git pull a local repository of VCPKG to `d:\vcpkg` in sync with the `main` branch of the VCPKG repository.
532-
15. Run the PowerShell script `build\updatevcpkg.ps1` to update the DirectXMath port in VCPKG with the new release version. This will edit the files in `ports\directxmath`.
533-
16. Test the VCPKG port using all appropriate triplets and features.
534-
17. Run `.\vcpkg --x-add-version directxmath` to update the VCPKG versioning history.
535-
18. Submit a PR to the VCPKG GitHub repository to update the DirectXMath port. The PR will be reviewed and merged by the VCPKG maintainers.
536-
19. For the DirectXMath release to be included in the next Windows SDK, prepare a PR for the MSCodeHub project from the `main` branch to the `ms_sdk_release` branch. When the PR is complete, the Azure DevOps pipeline will automatically build vpack and submit a PR for further review.
537-
538-
> When fully completed, be sure to update the GitHub release with links to the matching NuGet packages and the VCPKG port.
519+
The release process is documented in the [release skill](.github/skills/release/SKILL.md). Invoke the `release` skill for step-by-step guidance when performing a release.

.github/skills/release/SKILL.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: Release Process
3+
description: Guide for performing the DirectXMath release process. Use this skill when asked to help with releasing a new version, publishing packages, or updating ports.
4+
---
5+
6+
# Release Process
7+
8+
## Prerequisites
9+
10+
- All changes merged into the `main` branch with all tests passing.
11+
- GPG signing configured for your GitHub account (for verified tags).
12+
- Access to the MSCodeHub mirror repository and Azure DevOps pipelines.
13+
- Local repository:
14+
- VCPKG at `d:\vcpkg` (synced with `main` branch)
15+
- PATs will be needed for scripts that access GitHub and ADO.
16+
17+
<!-- markdownlint-disable MD029 -->
18+
## Steps
19+
20+
### Phase 1: Prepare Release
21+
22+
1. Git pull the local repository to ensure it is up to date with the `main` branch.
23+
2. Run the PowerShell script `build\preparerelease.ps1` which will generate a topic branch for the release, update the version number in `CMakeLists.txt`, the `README.md` file, the release notes in the nuspec files, and create a stub in the `CHANGELOG.md` file for the new release.
24+
3. Edit the `CHANGELOG.md` file to update it with a summary of changes.
25+
4. Submit the topic branch for review and merge into `main` once approved. Allow the GitHub Actions workflows and the Azure DevOps pipelines to complete successfully before proceeding.
26+
27+
### Phase 2: Tag and Create GitHub Release
28+
29+
5. Run the PowerShell script `build\completerelease.ps1` which will set a tag on the project repo and the test repo, and create a release on GitHub with the release notes from `CHANGELOG.md`. Ensure you have set up GPG signing for your GitHub account so that the tags will be verified.
30+
6. Git pull the local repository to ensure it is up to date with the `main` branch. Be sure to include `--tags`.
31+
32+
### Phase 3: MSCodeHub and Signed Binaries
33+
34+
7. Push the `main` branch to the MSCodeHub mirror repository. Be sure to include `--tags`.
35+
8. Create a PR on MSCodeHub from the `main` branch to the `release` branch.
36+
9. Merge the PR on MSCodeHub to update the release branch, which will trigger the Azure DevOps pipeline to build the NuGet package.
37+
38+
### Phase 4: Source Archive Signing
39+
40+
10. Download the GitHub source .zip archive from the release. Unzip and compare to the local repo to ensure it matches — keep in mind there may be some CR/LF differences.
41+
11. Run minisign on the .zip to generate a signature file, and upload the signature file to the release assets.
42+
43+
### Phase 5: NuGet Validation and Publishing
44+
45+
12. Download the NuGet package from the ADO pipeline build, and review it with a local project or using NuGet Package Explorer.
46+
13. Upload the nupkg to nuget.org via the website.
47+
48+
### Phase 6: VCPKG Port Update
49+
50+
14. Git pull a local repository of VCPKG to `d:\vcpkg` in sync with the `main` branch of the VCPKG repository.
51+
15. Run the PowerShell script `build\updatevcpkg.ps1` to update the DirectXMath port in VCPKG with the new release version. This will edit the files in `ports\directxmath`.
52+
16. Test the VCPKG port using the script at `assets/vcpkgdxmath.cmd` (in this skill folder). Copy it to `d:\vcpkg` and run from there after bootstrapping VCPKG.
53+
17. Run `.\vcpkg x-add-version directxmath` to update the VCPKG versioning history.
54+
18. Submit a PR to the VCPKG GitHub repository to update the DirectXMath port. The PR will be reviewed and merged by the VCPKG maintainers.
55+
56+
### Phase 7: Windows SDK Update
57+
58+
19. For the DirectXMath release to be included in the next Windows SDK, prepare a PR for the MSCodeHub project from the `main` branch to the `ms_sdk_release` branch. When the PR is complete, the Azure DevOps pipeline will automatically build vpack and submit a PR for further review.
59+
60+
### Phase 8: Finalize
61+
62+
When fully completed, be sure to update the GitHub release with links to the matching NuGet packages and the VCPKG port.
63+
64+
## Key Scripts
65+
66+
| Script | Purpose |
67+
| --- | --- |
68+
| `build\preparerelease.ps1` | Creates topic branch, updates version numbers and changelog stub |
69+
| `build\completerelease.ps1` | Sets tags, creates GitHub release from changelog |
70+
| `build\updatevcpkg.ps1` | Updates DirectXMath VCPKG port files |
71+
| `assets\vcpkgdxmath.cmd` | Tests VCPKG port across all triplets and features |
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
@set VCPKG_BINARY_SOURCES=clear
2+
@set VCPKG_ROOT=%cd%
3+
@if %1.==xbox. goto xbox
4+
@if %1.==clang. goto clang
5+
.\vcpkg install directxmath:x86-windows
6+
@if errorlevel 1 goto error
7+
.\vcpkg install directxmath[xdsp]:x86-windows --recurse
8+
@if errorlevel 1 goto error
9+
.\vcpkg install directxmath[dx11]:x86-windows --recurse
10+
@if errorlevel 1 goto error
11+
.\vcpkg install directxmath[dx12]:x86-windows --recurse
12+
@if errorlevel 1 goto error
13+
.\vcpkg install directxmath:x86-windows-static
14+
@if errorlevel 1 goto error
15+
.\vcpkg install directxmath[dx11,dx12]:x86-windows-static --recurse
16+
@if errorlevel 1 goto error
17+
.\vcpkg install directxmath:x86-windows-static-md
18+
@if errorlevel 1 goto error
19+
.\vcpkg install directxmath[dx11,dx12]:x86-windows-static-md --recurse
20+
@if errorlevel 1 goto error
21+
.\vcpkg install directxmath:x64-windows
22+
@if errorlevel 1 goto error
23+
.\vcpkg install directxmath[xdsp]:x64-windows --recurse
24+
@if errorlevel 1 goto error
25+
.\vcpkg install directxmath[dx11]:x64-windows --recurse
26+
@if errorlevel 1 goto error
27+
.\vcpkg install directxmath[dx12]:x64-windows --recurse
28+
@if errorlevel 1 goto error
29+
.\vcpkg install directxmath:x64-windows-static
30+
@if errorlevel 1 goto error
31+
.\vcpkg install directxmath[dx11,dx12]:x64-windows-static --recurse
32+
@if errorlevel 1 goto error
33+
.\vcpkg install directxmath:x64-windows-static-md
34+
@if errorlevel 1 goto error
35+
.\vcpkg install directxmath[dx11,dx12]:x64-windows-static-md --recurse
36+
@if errorlevel 1 goto error
37+
.\vcpkg install directxmath:arm64-windows
38+
@if errorlevel 1 goto error
39+
.\vcpkg install directxmath[xdsp]:arm64-windows --recurse
40+
@if errorlevel 1 goto error
41+
.\vcpkg install directxmath[dx11]:arm64-windows --recurse
42+
@if errorlevel 1 goto error
43+
.\vcpkg install directxmath[dx12]:arm64-windows --recurse
44+
@if errorlevel 1 goto error
45+
.\vcpkg install directxmath:arm64-windows-static
46+
@if errorlevel 1 goto error
47+
.\vcpkg install directxmath[dx11,dx12]:arm64-windows-static --recurse
48+
@if errorlevel 1 goto error
49+
.\vcpkg install directxmath:arm64-windows-static-md
50+
@if errorlevel 1 goto error
51+
.\vcpkg install directxmath[dx11,dx12]:arm64-windows-static-md --recurse
52+
@if errorlevel 1 goto error
53+
.\vcpkg install directxmath:x86-uwp
54+
@if errorlevel 1 goto error
55+
.\vcpkg install directxmath[xdsp]:x86-uwp --recurse
56+
@if errorlevel 1 goto error
57+
.\vcpkg install directxmath[dx11]:x86-uwp --recurse
58+
@if errorlevel 1 goto error
59+
.\vcpkg install directxmath[dx12]:x86-uwp --recurse
60+
@if errorlevel 1 goto error
61+
.\vcpkg install directxmath:x64-uwp
62+
@if errorlevel 1 goto error
63+
.\vcpkg install directxmath[xdsp]:x64-uwp --recurse
64+
@if errorlevel 1 goto error
65+
.\vcpkg install directxmath[dx11]:x64-uwp --recurse
66+
@if errorlevel 1 goto error
67+
.\vcpkg install directxmath[dx12]:x64-uwp --recurse
68+
@if errorlevel 1 goto error
69+
.\vcpkg install directxmath:arm64-uwp
70+
@if errorlevel 1 goto error
71+
.\vcpkg install directxmath[xdsp]:arm64-uwp --recurse
72+
@if errorlevel 1 goto error
73+
.\vcpkg install directxmath[dx11]:arm64-uwp --recurse
74+
@if errorlevel 1 goto error
75+
.\vcpkg install directxmath[dx12]:arm64-uwp --recurse
76+
@if errorlevel 1 goto error
77+
@where /Q x86_64-w64-mingw32-g++.exe
78+
@if errorlevel 1 goto skipgcc64
79+
.\vcpkg install directxmath:x64-mingw-static
80+
@if errorlevel 1 goto error
81+
.\vcpkg install directxmath[xdsp]:x64-mingw-static --recurse
82+
@if errorlevel 1 goto error
83+
.\vcpkg install directxmath[dx11]:x64-mingw-static --recurse
84+
@if errorlevel 1 goto error
85+
.\vcpkg install directxmath[dx12]:x64-mingw-static --recurse
86+
@if errorlevel 1 goto error
87+
:skipgcc64
88+
@where /Q i686-w64-mingw32-g++.exe
89+
@if errorlevel 1 goto skipgcc32
90+
.\vcpkg install directxmath:x86-mingw-static
91+
@if errorlevel 1 goto error
92+
.\vcpkg install directxmath[xdsp]:x86-mingw-static --recurse
93+
@if errorlevel 1 goto error
94+
.\vcpkg install directxmath[dx11]:x86-mingw-static --recurse
95+
@if errorlevel 1 goto error
96+
.\vcpkg install directxmath[dx12]:x86-mingw-static --recurse
97+
@if errorlevel 1 goto error
98+
:skipgcc32
99+
@if "%GXDKLatest%."=="." goto finish
100+
:xbox
101+
.\vcpkg install directxmath:x64-xbox-scarlett
102+
@if errorlevel 1 goto error
103+
.\vcpkg install directxmath[xdsp]:x64-xbox-scarlett --recurse
104+
@if errorlevel 1 goto error
105+
.\vcpkg install directxmath[dx12]:x64-xbox-scarlett --recurse
106+
@if errorlevel 1 goto error
107+
.\vcpkg install directxmath:x64-xbox-scarlett-static
108+
@if errorlevel 1 goto error
109+
.\vcpkg install directxmath[dx12]:x64-xbox-scarlett-static --recurse
110+
@if errorlevel 1 goto error
111+
.\vcpkg install directxmath:x64-xbox-xboxone
112+
@if errorlevel 1 goto error
113+
.\vcpkg install directxmath[xdsp]:x64-xbox-xboxone --recurse
114+
@if errorlevel 1 goto error
115+
.\vcpkg install directxmath[dx12]:x64-xbox-xboxone --recurse
116+
@if errorlevel 1 goto error
117+
.\vcpkg install directxmath:x64-xbox-xboxone-static
118+
@if errorlevel 1 goto error
119+
.\vcpkg install directxmath[dx12]:x64-xbox-xboxone-static --recurse
120+
@if errorlevel 1 goto error
121+
@goto finish
122+
:clang
123+
.\vcpkg install directxmath:x64-clangcl-dynamic
124+
@if errorlevel 1 goto error
125+
.\vcpkg install directxmath:x64-clangcl-static
126+
@if errorlevel 1 goto error
127+
.\vcpkg install directxmath[xdsp]:x64-clangcl-static --recurse
128+
@if errorlevel 1 goto error
129+
.\vcpkg install directxmath[dx11]:x64-clangcl-static --recurse
130+
@if errorlevel 1 goto error
131+
.\vcpkg install directxmath[dx12]:x64-clangcl-static --recurse
132+
@if errorlevel 1 goto error
133+
.\vcpkg install directxmath:x64-clangcl-uwp
134+
@if errorlevel 1 goto error
135+
.\vcpkg install directxmath[xdsp]:x64-clangcl-uwp --recurse
136+
@if errorlevel 1 goto error
137+
.\vcpkg install directxmath[dx11]:x64-clangcl-uwp --recurse
138+
@if errorlevel 1 goto error
139+
.\vcpkg install directxmath[dx12]:x64-clangcl-uwp --recurse
140+
@if errorlevel 1 goto error
141+
.\vcpkg install directxmath:arm64-clangcl-dynamic
142+
@if errorlevel 1 goto error
143+
.\vcpkg install directxmath:arm64-clangcl-static
144+
@if errorlevel 1 goto error
145+
.\vcpkg install directxmath[xdsp]:arm64-clangcl-static --recurse
146+
@if errorlevel 1 goto error
147+
.\vcpkg install directxmath[dx11]:arm64-clangcl-static --recurse
148+
@if errorlevel 1 goto error
149+
.\vcpkg install directxmath[dx12]:arm64-clangcl-static --recurse
150+
@if errorlevel 1 goto error
151+
.\vcpkg install directxmath:arm64-clangcl-uwp
152+
@if errorlevel 1 goto error
153+
.\vcpkg install directxmath[xdsp]:arm64-clangcl-uwp --recurse
154+
@if errorlevel 1 goto error
155+
.\vcpkg install directxmath[dx11]:arm64-clangcl-uwp --recurse
156+
@if errorlevel 1 goto error
157+
.\vcpkg install directxmath[dx12]:arm64-clangcl-uwp --recurse
158+
@if errorlevel 1 goto error
159+
@if "%GXDKLatest%."=="." goto finish
160+
.\vcpkg install directxmath:x64-clangcl-scarlett
161+
@if errorlevel 1 goto error
162+
.\vcpkg install directxmath[xdsp]:x64-clangcl-scarlett --recurse
163+
@if errorlevel 1 goto error
164+
.\vcpkg install directxmath[dx12]:x64-clangcl-scarlett --recurse
165+
@if errorlevel 1 goto error
166+
.\vcpkg install directxmath:x64-clangcl-scarlett-static
167+
@if errorlevel 1 goto error
168+
.\vcpkg install directxmath[dx12]:x64-clangcl-scarlett-static --recurse
169+
@if errorlevel 1 goto error
170+
.\vcpkg install directxmath:x64-clangcl-xboxone
171+
@if errorlevel 1 goto error
172+
.\vcpkg install directxmath[xdsp]:x64-clangcl-xboxone --recurse
173+
@if errorlevel 1 goto error
174+
.\vcpkg install directxmath[dx12]:x64-clangcl-xboxone --recurse
175+
@if errorlevel 1 goto error
176+
.\vcpkg install directxmath:x64-clangcl-xboxone-static
177+
@if errorlevel 1 goto error
178+
.\vcpkg install directxmath[dx12]:x64-clangcl-xboxone-static --recurse
179+
@if errorlevel 1 goto error
180+
:finish
181+
@echo SUCCEEDED
182+
@if %1.==xbox. goto eof
183+
@if %1.==clang. goto eof
184+
@echo .
185+
@echo . Run on x64-linux and arm64-linux
186+
@echo . ./vcpkg install directxmath
187+
@echo . ./vcpkg install directxmath[xdsp] --recurse
188+
@echo . ./vcpkg install directxmath[dx12] --recurse
189+
@where /Q x86_64-w64-mingw32-g++.exe
190+
@if NOT errorlevel 1 goto gcc64
191+
@echo .
192+
@echo . Run for MinGW64
193+
@echo . .\vcpkg install directxmath:x64-mingw-static
194+
@echo . .\vcpkg install directxmath[xdsp]:x64-mingw-static --recurse
195+
@echo . .\vcpkg install directxmath[dx11]:x64-mingw-static --recurse
196+
@echo . .\vcpkg install directxmath[dx12]:x64-mingw-static --recurse
197+
:gcc64
198+
@where /Q i686-w64-mingw32-g++.exe
199+
@if NOT errorlevel 1 goto gcc32
200+
@echo .
201+
@echo . Run for MinGW32
202+
@echo . .\vcpkg install directxmath:x86-mingw-static
203+
@echo . .\vcpkg install directxmath[xdsp]:x86-mingw-static --recurse
204+
@echo . .\vcpkg install directxmath[dx11]:x86-mingw-static --recurse
205+
@echo . .\vcpkg install directxmath[dx12]:x86-mingw-static --recurse
206+
:gcc32
207+
@goto eof
208+
:error
209+
@echo FAILED
210+
:eof

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
5959

6060
- name: Initialize CodeQL
61-
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v3.29.5
61+
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
6262
with:
6363
languages: c-cpp
6464
build-mode: manual
@@ -72,6 +72,6 @@ jobs:
7272
run: cmake --build out/build/x64-Debug
7373

7474
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v3.29.5
75+
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
7676
with:
7777
category: "/language:c-cpp"

.github/workflows/msvc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ jobs:
6565

6666
# Upload SARIF file to GitHub Code Scanning Alerts
6767
- name: Upload SARIF to GitHub
68-
uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v3.29.5
68+
uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
6969
with:
7070
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
/wiki
2424
/out
2525
/CMakeUserPresets.json
26+
!**/skills/**

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,26 @@ These components are designed to work without requiring any content from the leg
5353

5454
* Contains miscellaneous build files and scripts.
5555

56+
* ``skills\``
57+
58+
* Contains published CoPilot skills for use by developers.
59+
5660
## Documentation
5761

5862
Documentation is available on the [Microsoft Docs](https://docs.microsoft.com/en-us/windows/desktop/dxmath/directxmath-portal). Additional information can be found on the [project wiki](https://github.com/microsoft/DirectXMath/wiki).
5963

64+
## CoPilot Usage
65+
66+
For CoPilot CLI assistance with using DirectXMath, try:
67+
68+
```bash
69+
winget install GitHub.Copilot
70+
winget install GitHub.cli
71+
gh skill install microsoft/directxmath
72+
copilot
73+
/skills list
74+
```
75+
6076
## Compiler support
6177

6278
Officially the library is supported with Microsoft Visual C++ 2019 (16.11) or later, clang/LLVM v12 or later, and GCC 10 or later. It should also compile with the Intel C++ and MinGW compilers.

0 commit comments

Comments
 (0)