Publish latest release to nuget
ActionsCheckout to version of last release, build, test and publish on nuget.org package with same version as release
v1
LatestBy maxchistt
Tags
(2)Action to build latest release and publicate it on nuget as package with same version
-
Create API key on nuget.org and save it on GitHub in 'Secrets and variables'
-
Add to your .csproj file:
<PropertyGroup> <TargetFramework>net7.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <Title>MyPackage</Title> <PackageId>MyPackage</PackageId> <Description>About</Description> <RepositoryUrl>https://github.com/user/repo</RepositoryUrl> <RepositoryType>git</RepositoryType> <Authors>NugetUsername</Authors> </PropertyGroup>
-
Create GitHub action:
name: Release to NuGet on: release: types: [published] jobs: build: runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: NugetPublish uses: maxchistt/action-publish-nuget@v1 with: NUGET_APIKEY: ${{secrets.NUGET_APIKEY}} working-directory: ./MyPackage
-
Publish GitHub release, named like 'v1.0.0' or '1.0.0'
Publish latest release to nuget is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.