Skip to content

Commit

Permalink
Adding publish nuget action
Browse files Browse the repository at this point in the history
  • Loading branch information
bgriggs committed May 4, 2024
1 parent 7e17669 commit f0dacaa
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET
name: Build

on:
push:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to Nuget

on:
release:
types: [published]


permissions:
contents: read
packages: write # permission for the github token

jobs:
build:
runs-on: windows-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build JetdriveSharp/JetdriveSharp.csproj --no-restore --configuration Release
- name: Create the package
run: dotnet pack JetdriveSharp/JetdriveSharp.csproj --configuration Release
- name: Publish the package to Nuget
run: dotnet nuget push JetdriveSharp/bin/Release/net8.0/*.nupkg -s https://api.nuget.org/v3/index.json
1 change: 1 addition & 0 deletions JetdriveSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
README.md = README.md
EndProjectSection
EndProject
Expand Down
30 changes: 19 additions & 11 deletions JetdriveSharp/JetdriveSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.1.0</Version>
<IncludeSymbols>True</IncludeSymbols>
<RepositoryUrl>https://github.com/bgriggs/jetdrive-sharp</RepositoryUrl>
<IncludeSymbols>True</IncludeSymbols>
<Title>Jetdrive Sharp</Title>
<Description>Dynojet jetdrive sdk.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>

0 comments on commit f0dacaa

Please sign in to comment.