Skip to content

Commit

Permalink
Created a workflow for NuGet and for the viewer executable (#7)
Browse files Browse the repository at this point in the history
* Create dotnet-desktop.yml

* Updating NET and creating a workflow

* Adding NET Standard for very old users

* Fixing missing framework
  • Loading branch information
xafero authored Apr 15, 2024
1 parent 04ef0e0 commit 2607319
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: .NET Build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: windows-latest
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: dotnet build -c Release

- name: Pack
run: dotnet pack -c Release --no-build -o nupkg

- name: Publish
run: dotnet publish -p:PublishSingleFile=true -r win-x64 -f net8.0-windows -c Release --self-contained false ImageViewer\ImageViewer.csproj -o dist

- name: Upload
uses: actions/upload-artifact@v4
with:
name: All NuGet packages
path: nupkg

- name: Upload
uses: actions/upload-artifact@v4
with:
name: All app executables
path: dist
2 changes: 1 addition & 1 deletion ImageFormats/FitsReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static Image Load(Stream stream)
else if (headerSeq > 0 && !itemStr.StartsWith("XTENSION")) { return bmp; }
}

if (!itemStr.Contains('=')) { continue; }
if (!itemStr.Contains('=' + "")) { continue; }

string[] parts = itemStr.Split('=');
if (parts.Length < 2) { continue; }
Expand Down
25 changes: 22 additions & 3 deletions ImageFormats/ImageFormats.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks>
<LangVersion>latest</LangVersion>

<RootNamespace>DmitryBrant.ImageFormats</RootNamespace>
<AssemblyName>ImageFormats</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<PackageId>DmitryBrant.ImageFormats</PackageId>
<Version>1.0.1</Version>
<Title>ImageFormats</Title>
<Authors>Dmitry Brant</Authors>
<Copyright>Copyright © Dmitry Brant, 2021-</Copyright>
<PackageProjectUrl>https://dmitrybrant.com</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/dbrant/imageformats</RepositoryUrl>
<Description>Library for decoding old and obscure image formats.</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>decoding;graphics;images;library;targa;tga;ras;sun;zsoft;pcx;netpbm;ppm;pgm;pbm;pnm;sgi;dicom</PackageTags>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0' OR '$(TargetFramework)'=='net8.0'">
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.7" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion ImageViewer/ImageViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFrameworks>net8.0-windows;net6.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageViewer</RootNamespace>
Expand All @@ -12,6 +12,7 @@
<Authors>Dmitry Brant</Authors>
<Description></Description>
<Copyright>Copyright © Dmitry Brant, 2020</Copyright>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 2607319

Please sign in to comment.