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
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release to NuGet

on:
release:
types: [published]

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

- name: Set version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Verify version format
run: |
if ! echo "$VERSION" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
echo "Invalid version format. Must follow semantic versioning (e.g., 1.0.0 or 1.0.0-beta.1)"
exit 1
fi

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore /p:Version=${VERSION}

- name: Test
run: dotnet test --configuration Release --no-build

- name: Pack
run: dotnet pack src/Daqifi.Core/Daqifi.Core.csproj --configuration Release --no-build -p:PackageVersion=${VERSION} --output nupkgs

- name: Push to NuGet
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,20 @@ The DAQiFi Core Library is a .NET library designed to simplify interaction with

### Installation

The DAQiFi Core Library will be available on NuGet.
```shell
dotnet add package Daqifi.Core
```

## Publishing

This library follows semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes

Releases are automated via GitHub Actions:
1. Create a new GitHub Release
2. Tag it with `vX.Y.Z` (e.g. `v1.0.0`)
3. For pre-releases, use `-alpha.1`, `-beta.1`, `-rc.1` suffixes
4. Publishing to NuGet happens automatically on release

24 changes: 18 additions & 6 deletions src/Daqifi.Core/Daqifi.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,29 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Version info -->
<Version>0.1.0</Version>
<AssemblyVersion>0.1.0.0</AssemblyVersion>
<FileVersion>0.1.0.0</FileVersion>

<!-- NuGet package info -->
<!-- Package Metadata -->
<PackageId>Daqifi.Core</PackageId>
<Authors>DAQiFi</Authors>
<Description>Core library for interacting with DAQiFi devices</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/daqifi/daqifi-core</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>daqifi;daq;data-acquisition;measurement;instrumentation</PackageTags>
<RepositoryUrl>https://github.com/daqifi/daqifi-core</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- Build Configuration -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="/" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

</Project>