Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Slion committed Jan 8, 2024
1 parent 0ae10fc commit a64a4a5
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


env:
DOTNET_VERSION: 7.0.x
BUILD_TARGET: .\Project\SharpLibEuropeanDataFormat.sln


jobs:
build:
name: .NET Build
runs-on: windows-latest
# Don't build for release the publish workflow will do that to
if: "!startsWith(github.event.head_commit.message, 'Release v')"

steps:
- uses: actions/checkout@v2

- name: Use .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build
run: dotnet build ${{ env.BUILD_TARGET }} -c Release
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish

on:
push:
branches: [ main ]

env:
DOTNET_VERSION: 7.0.x
BUILD_TARGET: .\Project\SharpLibEuropeanDataFormat.sln

jobs:
build:
name: .NET Build
runs-on: windows-latest
if: "startsWith(github.event.head_commit.message, 'Release v')"

steps:
- uses: actions/checkout@v2

- name: Use .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build
run: dotnet build ${{ env.BUILD_TARGET }} -c Release

- name: Pack
run: dotnet pack ${{ env.BUILD_TARGET }} -c Release --no-build

- name: Upload artifacts
uses: actions/upload-artifact@v2.3.1
with:
name: nuget-packages
path: "**/*.nupkg"


publish:
name: Publish to NuGet
runs-on: windows-latest
needs: build
if: "startsWith(github.event.head_commit.message, 'Release v')"

steps:
- name: Use NuGet
uses: NuGet/setup-nuget@v1.0.5
with:
nuget-version: latest
nuget-api-key: ${{ secrets.NUGET_API_KEY }}

- name: Fetch artifacts
uses: actions/download-artifact@v2.1.0
with:
name: nuget-packages

- name: Publish
run: nuget push **\*.nupkg -Source https://api.nuget.org/v3/index.json
25 changes: 25 additions & 0 deletions Project/Lib/SharpLibEuropeanDataFormat.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
<PackageId>SharpLibEuropeanDataFormat</PackageId>
<OutputType>Library</OutputType>
<RootNamespace>SharpLib.EuropeanDataFormat</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>0.2.0</Version>
<Product>SharpLibEuropeanDataFormat</Product>
<Authors>Stéphane Lenclud and contributors</Authors>
<Company>slions.net</Company>
<Copyright>Copyright © 2023 Stéphane Lenclud</Copyright>
<Description>C# library providing easy access to European Data Format (EDF) content.</Description>
<RepositoryUrl>https://github.com/Slion/SharpLibEuropeanDataFormat</RepositoryUrl>
<PackageProjectUrl>https://github.com/Slion/SharpLibEuropeanDataFormat</PackageProjectUrl>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>Windows;Windows10;Windows11;Medicine;EDF;</PackageTags>
<Title>European Data Format Library (EDF)</Title>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>
v0.2.0 Various bug fix and support for .NET 6, 7 and 8.
v0.1.4 Support reading floating point record duration.
v0.1.3 Making sure files can be shared while reading them.
v0.1.2 Reading signal by name now returns Signal object.
v0.1.1 Reading multiple single signals now works.
v0.1.0 Adding the ability to read a single signal.
v0.0.6 Adding function to compute signal sample time.
v0.0.5 Fixing date parsing issue on machine with en-US format.
v0.0.3 Start time and record time as DateTime. Various refactoring.
</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<OutputPath>bin\x86\Debug\</OutputPath>
Expand Down

0 comments on commit a64a4a5

Please sign in to comment.