Skip to content

Commit 8681b1b

Browse files
committed
create the nuget packages for DirectNet.Net
1 parent ff42377 commit 8681b1b

File tree

3 files changed

+47
-57
lines changed

3 files changed

+47
-57
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ErabliereAPI.Proxy-Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-include:
8+
- DirectNet.Net/**
9+
- .github/workflows/directnet-nuget-publish.yaml
10+
workflow_dispatch:
11+
12+
env:
13+
name: PROJECT_PATH
14+
value: DirectNet.Net/DirectNet.Net.csproj
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: dotnet build
23+
run: dotnet build $PROJECT_PATH -c Release -o bin/Release
24+
25+
- name: Push the package to nuget.org
26+
run: |
27+
# Extract the version from the csproj file
28+
VERSION=$(grep -Eoi "<version>([[:digit:]\.]+)</version>" DirectNet.Net/DirectNet.Net.csproj | sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p')
29+
30+
# Publish the package to nuget.org
31+
dotnet nuget push ./bin/Release/DirectNet.Net.$VERSION.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.DirectNetAPIKey }}

DirectNet.Net/DirectNet.Net.csproj

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,25 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<PackageId>DirectNet.Net</PackageId>
12+
<Version>1.0.0</Version>
13+
<Authors>Frédéric Jacques</Authors>
14+
<Company>ErabliereAPI</Company>
15+
<PackageTags>DirectNet;Automation Direct</PackageTags>
16+
<Description>
17+
DirectNet.Net is a package that allow to communicate on a serial port to a
18+
automation direct PLC using the DirectNet protocol.
19+
</Description>
20+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
21+
<ProjectUrl>https://github.com/freddycoder/DirectNet.Net</ProjectUrl>
22+
<Copyright>Copyright © ErabliereAPI 2022</Copyright>
723
</PropertyGroup>
824

925
<ItemGroup>
10-
<PackageReference Include="ErabliereAPI.Proxy" Version="1.0.2" />
1126
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
1227
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
1328
</ItemGroup>

DirectNet.Net/DirectNet.Net.nuspec

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)