Skip to content

Commit 2f418d6

Browse files
committed
chore: align NuGet/GitHub release naming and docs
1 parent f3c971d commit 2f418d6

7 files changed

Lines changed: 105 additions & 332 deletions

File tree

.github/workflows/package.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ jobs:
237237
-Configuration '${{ matrix.config }}'
238238
-WindowsSdkVersion '10.0.22621.0'
239239
240-
test-release-native-cmake:
241-
name: Test release native CMake asset ${{ matrix.arch }} ${{ matrix.config }}
240+
test-release-prebuilt-cmake:
241+
name: Test release prebuilt CMake asset ${{ matrix.arch }} ${{ matrix.config }}
242242
needs: pack
243243
runs-on: windows-2022
244244
strategy:
@@ -255,7 +255,7 @@ jobs:
255255
name: crtsys-release-assets-${{ needs.pack.outputs.package_version }}
256256
path: artifacts/release
257257

258-
- name: Build native release CMake consumer test
258+
- name: Build prebuilt release CMake consumer test
259259
shell: pwsh
260260
run: >
261261
./scripts/nuget/Test-CrtSysReleaseAssets.ps1
@@ -307,7 +307,7 @@ jobs:
307307

308308
github-release:
309309
name: Upload GitHub Release Assets
310-
needs: [pack, test-package-driver, test-package-app, test-release-native-cmake]
310+
needs: [pack, test-package-driver, test-package-app, test-release-prebuilt-cmake]
311311
if: ${{ (github.event_name != 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && inputs.github_release) }}
312312
runs-on: windows-2022
313313
permissions:
@@ -349,7 +349,7 @@ jobs:
349349
"crtsys $version release assets."
350350
""
351351
"- crtsys.$version.nupkg: offline NuGet package"
352-
"- crtsys-$version-native.zip: headers, docs, CMake helpers, native MSBuild imports, and prebuilt x64/ARM64 Debug/Release libraries"
352+
"- crtsys-$version-prebuilt.zip: headers, docs, CMake helpers, native MSBuild imports, and prebuilt x64/ARM64 Debug/Release libraries"
353353
"- crtsys-$version-SHA256SUMS.txt: SHA-256 checksums"
354354
) -join [Environment]::NewLine
355355
& gh release create $tagName @assets --repo $repo --target '${{ github.sha }}' --title "crtsys $version" --notes $notes

README.md

Lines changed: 17 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ project(my_driver LANGUAGES C CXX)
125125
include(cmake/CPM.cmake)
126126
127127
set(CRTSYS_NTL_MAIN ON)
128-
CPMAddPackage("gh:ntoskrnl7/crtsys@0.1.10")
128+
CPMAddPackage("gh:ntoskrnl7/crtsys@<version>")
129129
include(${crtsys_SOURCE_DIR}/cmake/CrtSys.cmake)
130130
131131
crtsys_add_driver(my_driver src/main.cpp)
@@ -163,121 +163,45 @@ cmake --build build_x64 --config Debug
163163

164164
## NuGet Package
165165

166-
`crtsys` can be distributed as a native NuGet package for Visual Studio/MSBuild
167-
projects. The package includes public NTL headers, internal compatibility
168-
headers, native MSBuild imports, and prebuilt `crtsys.lib`/`Ldk.lib` driver
169-
binaries.
170-
171-
The package has two consumer modes:
172-
173-
- App mode: normal Visual C++ application projects get the public NTL headers
174-
and C++ compatibility options only. No driver libraries, forced include, or
175-
driver entry point are added.
176-
- Driver mode: WDK driver projects get the CMake-equivalent driver settings:
177-
`crtsys` include paths, MSVC/STL compatibility headers before WDK `km\crt`,
178-
forced include setup, preprocessor definitions, `crtsys.lib`, `Ldk.lib`,
179-
`libcntpr.lib`, `/FORCE:MULTIPLE`, and the `CrtSysDriverEntry` entry point
180-
for the default `ntl::main` flow.
181-
182-
Driver mode is enabled automatically when MSBuild sees a driver project
183-
(`ConfigurationType=Driver` or `DriverType` is set). It can also be forced with
184-
`CrtSysUseDriverSupport=true`. The package does not turn a normal C++ project,
185-
console application, static library, or CMake project into a WDK driver project,
186-
and it does not install or replace the WDK toolset.
187-
188-
Driver builds may emit `LNK4088` because `crtsys` intentionally uses
189-
`/FORCE:MULTIPLE` for known duplicate CRT/runtime symbols between `libcntpr`,
190-
`Ldk`, `ntoskrnl`, and the runtime glue. Treat that as an expected build
191-
warning only when the remaining link output contains no unresolved symbols and
192-
the duplicate symbols are in the known runtime boundary. Final drivers still
193-
need load, verifier, signing, and target-OS validation.
194-
195-
The current binary package targets:
196-
197-
- Visual Studio 2022
198-
- Windows SDK/WDK `10.0.22621.0`
199-
- App header builds on `x86`, `x64`, and `ARM64`
200-
- Driver library builds on `x64` and `ARM64`
201-
- Debug/Release `crtsys.lib`, `Ldk.lib`, and WDK `libcntpr.lib`
202-
203-
Install it from Visual Studio's **Manage NuGet Packages** UI. In the Package
204-
Manager Console, select your app or driver project as the default project and
205-
run:
166+
`crtsys` NuGet distribution is:
206167

207-
```powershell
208-
Install-Package crtsys
209-
```
210-
211-
For an app project, include headers such as `ntl/rpc/client` directly.
212-
213-
For a driver project, define `ntl::main`:
168+
- `crtsys.<version>.nupkg`: install from Visual Studio/MSBuild.
214169

215-
```cpp
216-
#include <ntl/driver>
170+
Install from VS/MSBuild:
217171

218-
ntl::status ntl::main(ntl::driver& driver,
219-
const std::wstring& registry_path) {
220-
driver.on_unload([]() {});
221-
return ntl::status::ok();
222-
}
172+
```powershell
173+
Install-Package crtsys
223174
```
224175

225-
For native MSBuild consumers, the package also exposes `$(CrtSysRoot)`.
226-
See [NTL usage examples](./docs/usage-examples.md) for the app/driver RPC and
227-
raw IOCTL skeletons.
176+
## GitHub Release Prebuilt Bundle
228177

229-
Pack locally:
178+
GitHub Release publishes these offline-only assets:
230179

231-
```powershell
232-
.\scripts\nuget\Build-CrtSysNuGetLibs.ps1
233-
.\scripts\nuget\Pack-CrtSysNuGet.ps1
234-
```
180+
- `crtsys-<version>-prebuilt.zip`: headers, docs, CMake helpers,
181+
and prebuilt `x64/ARM64` `Debug`/`Release` libraries.
182+
- `crtsys-<version>-SHA256SUMS.txt`
235183

236-
Publish with an API key in the environment:
184+
Use the prebuilt bundle for WDK CMake/offline bootstrap:
237185

238186
```powershell
239-
$env:NUGET_API_KEY = '<nuget-api-key>'
240-
.\scripts\nuget\Push-CrtSysNuGet.ps1 -SkipDuplicate
187+
Expand-Archive .\crtsys-<version>-prebuilt.zip .
241188
```
242189

243-
GitHub Actions builds the prebuilt libraries and package on pull requests and
244-
pushes. A tag such as `v0.1.12` publishes to nuget.org through NuGet Trusted
245-
Publishing when the tag version matches `include/.internal/version`.
246-
The same tag build also creates GitHub Release assets. Manual workflow runs can
247-
set `github_release=true` to create or update the matching GitHub Release
248-
without pushing a tag.
249-
250-
Release assets include:
251-
252-
- `crtsys.<version>.nupkg` for offline NuGet installation.
253-
- `crtsys-<version>-native.zip` with headers, docs, CMake helpers, native
254-
MSBuild imports, and prebuilt x64/ARM64 Debug/Release driver libraries.
255-
- `crtsys-<version>-SHA256SUMS.txt` for asset checksums.
256-
257-
The native zip includes `cmake/CrtSys.cmake`, and the same `crtsys_add_driver`
258-
API can consume the prebuilt driver libraries when it is included from the
259-
unpacked bundle. A WDK CMake project can unpack the zip and use:
260-
261190
```cmake
262191
include(path/to/crtsys-<version>/cmake/CrtSys.cmake)
263192
crtsys_add_driver(my_driver src/main.cpp)
264193
```
265194

266-
For GitHub Actions publishing, create a nuget.org Trusted Publishing policy
267-
with the package owner shown by nuget.org, repository owner `ntoskrnl7`,
268-
repository `crtsys`, workflow file `package.yml`, and no environment
269-
restriction. Set the GitHub Actions repository variable
270-
`NUGET_TRUSTED_PUBLISHING_USER` to the nuget.org user that created the policy.
195+
For full packaging and publishing command details, see `nuget/README.md`.
271196

272-
To prepare a release without manually editing `include/.internal/version`, run
273-
the release helper from an up-to-date `main` branch:
197+
To publish a new version from `main`:
274198

275199
```powershell
276-
.\scripts\release\Prepare-CrtSysRelease.ps1 -Version 0.1.13 -Push
200+
.\scripts\release\Prepare-CrtSysRelease.ps1 -Version <version> -Push
277201
```
278202

279203
The helper updates `include/.internal/version`, commits the version bump,
280-
creates the matching `v0.1.13` tag, and pushes both the commit and tag. The tag
204+
creates the matching `v<version>` tag, and pushes both the commit and tag. The tag
281205
push starts the `Package` workflow.
282206

283207
The same flow is also available from the GitHub UI: open **Actions**,

docs/ko-kr.md

Lines changed: 17 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ project(my_driver LANGUAGES C CXX)
125125
include(cmake/CPM.cmake)
126126
127127
set(CRTSYS_NTL_MAIN ON)
128-
CPMAddPackage("gh:ntoskrnl7/crtsys@0.1.10")
128+
CPMAddPackage("gh:ntoskrnl7/crtsys@<version>")
129129
include(${crtsys_SOURCE_DIR}/cmake/CrtSys.cmake)
130130
131131
crtsys_add_driver(my_driver src/main.cpp)
@@ -163,131 +163,41 @@ cmake --build build_x64 --config Debug
163163

164164
## NuGet 패키지
165165

166-
`crtsys`는 Visual Studio/MSBuild 프로젝트에서 사용할 수 있는 native NuGet
167-
패키지로 배포할 수 있습니다. 패키지에는 공개 NTL 헤더, 내부 호환성 헤더,
168-
native MSBuild import 파일, 미리 빌드된 driver용 `crtsys.lib`
169-
`Ldk.lib`가 포함됩니다.
170-
171-
패키지는 두 가지 소비 모드를 가집니다.
172-
173-
- App mode: 일반 Visual C++ application 프로젝트에서는 공개 NTL 헤더와 C++
174-
호환성 옵션만 추가합니다. driver library, forced include, driver entry
175-
point는 추가하지 않습니다.
176-
- Driver mode: WDK driver 프로젝트에서는 CMake의 driver 설정과 같은 방향으로
177-
`crtsys` include 경로, WDK `km\crt`보다 앞서는 MSVC/STL 호환성 헤더,
178-
forced include, preprocessor 정의, `crtsys.lib`, `Ldk.lib`,
179-
`libcntpr.lib`, `/FORCE:MULTIPLE`, 기본 `ntl::main` 흐름을 위한
180-
`CrtSysDriverEntry` entry point를 설정합니다.
181-
182-
Driver mode는 MSBuild가 driver 프로젝트를 감지할 때 자동으로 켜집니다
183-
(`ConfigurationType=Driver` 또는 `DriverType`이 설정된 경우). 필요하면
184-
`CrtSysUseDriverSupport=true`로 강제로 켤 수 있습니다. 이 패키지는 일반 C++
185-
프로젝트, console application, static library, CMake 프로젝트를 WDK driver
186-
프로젝트로 변환하지 않으며 WDK toolset을 설치하거나 대체하지 않습니다.
187-
188-
driver build에서는 `LNK4088`이 보일 수 있습니다. `crtsys``libcntpr`,
189-
`Ldk`, `ntoskrnl`, runtime glue 사이의 알려진 CRT/runtime symbol 중복을
190-
처리하기 위해 의도적으로 `/FORCE:MULTIPLE`을 사용합니다. 이 경고는 남은
191-
link output에 unresolved symbol이 없고, 중복 symbol이 알려진 runtime 경계
192-
안에 있을 때만 예상 가능한 build warning으로 보아야 합니다. 최종 드라이버는
193-
여전히 load, verifier, signing, 대상 OS 검증이 필요합니다.
194-
195-
현재 binary 패키지 대상은 다음과 같습니다.
196-
197-
- Visual Studio 2022
198-
- Windows SDK/WDK `10.0.22621.0`
199-
- App header build: `x86`, `x64`, `ARM64`
200-
- Driver library build: `x64`, `ARM64`
201-
- Debug/Release `crtsys.lib`, `Ldk.lib`, WDK `libcntpr.lib`
202-
203-
Visual Studio의 **Manage NuGet Packages** UI에서 설치합니다. Package
204-
Manager Console을 사용할 때는 기본 프로젝트를 app 또는 driver 프로젝트로
205-
선택한 뒤 다음 명령을 실행합니다.
166+
`crtsys`의 NuGet 배포는 다음 하나뿐입니다.
167+
168+
- `crtsys.<version>.nupkg`: Visual Studio/MSBuild 프로젝트용
169+
170+
MSBuild 설치:
206171

207172
```powershell
208173
Install-Package crtsys
209174
```
210175

211-
App 프로젝트에서는 `ntl/rpc/client` 같은 헤더를 바로 포함해서 사용합니다.
212-
213-
Driver 프로젝트에서는 `ntl::main`을 정의합니다.
214-
215-
```cpp
216-
#include <ntl/driver>
176+
## GitHub Release prebuilt 번들
217177

218-
ntl::status ntl::main(ntl::driver& driver,
219-
const std::wstring& registry_path) {
220-
driver.on_unload([]() {});
221-
return ntl::status::ok();
222-
}
223-
```
178+
GitHub Release는 별도 오프라인 번들을 배포합니다.
224179

225-
native MSBuild 소비자를 위해 패키지는 `$(CrtSysRoot)` 속성도 제공합니다.
226-
app/driver RPC와 raw IOCTL 골격은 [NTL 사용 예제](./ko-kr-usage-examples.md)를
227-
참고하세요.
180+
- `crtsys-<version>-prebuilt.zip`: 헤더, 문서, CMake 헬퍼,
181+
x64/ARM64의 `Debug`/`Release` 사전 빌드 라이브러리.
182+
- `crtsys-<version>-SHA256SUMS.txt`
228183

229-
로컬에서 패키지를 만들려면 다음 명령을 사용합니다.
184+
WDK CMake/오프라인 부트스트랩은 prebuilt 번들을 사용합니다.
230185

231186
```powershell
232-
.\scripts\nuget\Build-CrtSysNuGetLibs.ps1
233-
.\scripts\nuget\Pack-CrtSysNuGet.ps1
234-
```
187+
Expand-Archive .\crtsys-<version>-prebuilt.zip .
235188
236-
환경 변수에 API key가 있을 때 publish할 수 있습니다.
237-
238-
```powershell
239-
$env:NUGET_API_KEY = '<nuget-api-key>'
240-
.\scripts\nuget\Push-CrtSysNuGet.ps1 -SkipDuplicate
241189
```
242190

243-
GitHub Actions도 pull request와 push에서 prebuilt library와 패키지를
244-
생성합니다. `v0.1.12` 같은 태그를 push하면, 태그 버전이
245-
`include/.internal/version`과 일치할 때 NuGet Trusted Publishing을 통해
246-
nuget.org로 publish합니다.
247-
같은 태그 빌드는 GitHub Release asset도 생성합니다. 수동 workflow 실행에서
248-
`github_release=true`를 지정하면 태그를 새로 push하지 않고도 해당 버전의
249-
GitHub Release를 만들거나 갱신할 수 있습니다.
250-
251-
Release asset에는 다음 파일이 포함됩니다.
252-
253-
- 오프라인 NuGet 설치용 `crtsys.<version>.nupkg`.
254-
- 헤더, 문서, CMake helper, native MSBuild import, x64/ARM64 Debug/Release
255-
driver library가 포함된 `crtsys-<version>-native.zip`.
256-
- asset 검증용 `crtsys-<version>-SHA256SUMS.txt`.
257-
258-
native zip에는 `cmake/CrtSys.cmake`가 포함되며, 이 파일을 unpack된 bundle에서
259-
include하면 같은 `crtsys_add_driver` API가 prebuilt driver library를
260-
사용합니다. WDK CMake 프로젝트에서는 zip을 푼 뒤 다음처럼 사용할 수
261-
있습니다.
262-
263191
```cmake
192+
# 기존 드라이버 CMakeLists.txt
264193
include(path/to/crtsys-<version>/cmake/CrtSys.cmake)
265194
crtsys_add_driver(my_driver src/main.cpp)
266195
```
267196

268-
GitHub Actions publish를 사용하려면 nuget.org Trusted Publishing policy를
269-
nuget.org에 표시되는 package owner, repository owner `ntoskrnl7`,
270-
repository `crtsys`, workflow file `package.yml`, environment 제한 없음으로
271-
생성합니다. GitHub Actions repository variable
272-
`NUGET_TRUSTED_PUBLISHING_USER`에는 policy를 생성한 nuget.org 사용자를
273-
설정합니다.
274-
275-
`include/.internal/version`을 직접 수정하지 않고 release를 준비하려면 최신
276-
`main` branch에서 release helper를 실행합니다.
277-
278-
```powershell
279-
.\scripts\release\Prepare-CrtSysRelease.ps1 -Version 0.1.13 -Push
280-
```
281-
282-
이 helper는 `include/.internal/version`을 수정하고, version bump commit을
283-
만든 뒤, 대응되는 `v0.1.13` tag를 만들고 commit과 tag를 push합니다. tag
284-
push가 `Package` workflow를 시작합니다.
197+
`prebuilt.zip`은 GitHub Release 전용 번들이며 NuGet 패키지가 아닙니다.
285198

286-
같은 흐름은 GitHub UI에서도 사용할 수 있습니다. **Actions**에서
287-
**Release**를 선택하고 **Run workflow**를 눌러 release version을 입력하면
288-
workflow가 version bump commit과 tag를 만들고, 그 tag 기준으로 `Package`
289-
workflow를 실행합니다. branch protection이 `main` 직접 push를 막는 경우에는
290-
로컬 helper를 사용하거나 release 규칙을 먼저 조정해야 합니다.
199+
릴리스/게시 방법, release helper, Trusted Publishing 설정은 `nuget/README.md`
200+
모아서 정리해두었습니다. 자세한 앱/드라이버 동작 방식도 같은 문서에서 확인하세요.
291201

292202
## 이 저장소 빌드
293203

0 commit comments

Comments
 (0)