Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Test PR

on:
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: windows-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Setup NuGet
uses: nuget/setup-nuget@v2.0.0

- name: Restore NuGet packages
run: nuget restore src\SearchPlatAPI.sln

- name: Build solution
run: msbuild src\SearchPlatAPI.sln /p:Configuration=Release /p:Platform=x64

- name: Run tests
run: vstest.console.exe src\x64\Release\test.dll
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release to NuGet

on:
push:
branches:
- release

jobs:
package-and-publish:
runs-on: windows-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup NuGet
uses: nuget/setup-nuget@v2.0.0

- name: Get version from nuspec
id: get_version
shell: pwsh
run: |
[xml]$nuspec = Get-Content SearchPlatAPI.nuspec
$version = $nuspec.package.metadata.version
echo "version=$version" >> $env:GITHUB_OUTPUT

- name: Pack NuGet package
run: nuget pack SearchPlatAPI.nuspec -Version ${{ steps.get_version.outputs.version }}

- name: Push to NuGet
run: nuget push *.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} -SkipDuplicate

- name: Upload package as artifact
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: '*.nupkg'
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# Windows Search Platform APIs
Public Wrappers for Common Windows Search Service Platform APIs

These APIs assist developers in programming against the Windows Search Service in a much easier fashion than today. APIs are pretty verbose, and spread across many different header files. This takes the most commonly used functionality and puts it in a simple to use header file for Win32 application developers.
These APIs assist developers in programming against the Windows Search Service in a much easier fashion than today. APIs are pretty verbose, and spread across many different header files. This takes the most commonly used functionality and puts it in a simple to use header file for Win32 application developers.

## CI/CD Workflows

This repository includes two GitHub Actions workflows:

### Pull Request Workflow
- **Trigger**: Pull requests to the `main` branch
- **Purpose**: Builds the solution and runs tests to ensure code quality
- **Steps**:
- Restores NuGet packages
- Builds the solution using MSBuild (Release x64)
- Runs unit tests with VSTest

### Release Workflow
- **Trigger**: Pushes to the `release` branch
- **Purpose**: Packages header files and publishes to NuGet
- **Steps**:
- Packages all header files from `src/api/` into a NuGet package
- Publishes to NuGet.org (requires `NUGET_API_KEY` secret)
- Uploads package as a build artifact

## NuGet Package

The header files are published as a NuGet package for easy consumption in C++ projects. The package includes all API headers from the `src/api/` directory.
20 changes: 20 additions & 0 deletions SearchPlatAPI.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>SearchPlatAPI</id>
<version>1.0.0</version>
<authors>SearchPlatAPI Contributors</authors>
<owners>SearchPlatAPI</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="file">LICENSE</license>
<projectUrl>https://github.com/brflynn/searchplatapi</projectUrl>
<description>Public Wrappers for Common Windows Search Service Platform APIs. These APIs assist developers in programming against the Windows Search Service in a much easier fashion than today.</description>
<releaseNotes>Initial release of SearchPlatAPI header files.</releaseNotes>
<copyright>Copyright (c) SearchPlatAPI Contributors</copyright>
<tags>windows search native cpp headers</tags>
</metadata>
<files>
<file src="LICENSE" target="" />
<file src="src/api/*.h" target="build/native/include" />
</files>
</package>
Loading