Skip to content
HavenDVPublic

Latest commit

 

History

167 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Using

name: Build, test and publish
on: [ push ]

jobs:
  build-test-publish:
    name: Build, test and publish
    uses: HavenDV/workflows/.github/workflows/dotnet_build-test-publish.yml@main
    with:
      asset-path1: src/installers/UpworkPdfGenerator.Installers.Wpf.NetFramework/UpworkPdfGenerator.msi
      asset-name1: UpworkPdfGenerator.msi

  nuget-trusted-publish:
    name: NuGet trusted publishing
    needs: build-test-publish
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: tryAGI/workflows/.github/actions/nuget-publish@main
        with:
          user: havendv
          artifact-pattern: nuget-packages-ubuntu-latest   # nuget-packages-<os input>

Explanation

This workflow is for developing and releasing a NuGet package by a small number of people on the same branch.
It is based on the Conventional Commits specification and will only release new releases if they contain fix/feat/perf commit types.
It automatically generates a build number (BUILD_NUMBER environment variable).
It also automatically generates Package Release Notes based on the latest commits (PACKAGE_RELEASE_NOTES environment variable).
It uploads the packages as the nuget-packages-<os> artifact; it does not push them to nuget.org itself. nuget.org trusted publishing matches the policy against the caller's workflow file, so the push runs in a caller job with tryAGI/workflows/.github/actions/nuget-publish (see the example above). Each repository needs a trusted publishing policy on nuget.org for that workflow file. There is no NuGet API key secret.

Inputs

name type default
os string 'ubuntu-latest'
dotnet-version string '6.0.x'
additional-dotnet-version string ''
include-prerelease boolean true
workloads string ''
windows-sdk-version string ''
windows-sdk-version2 string ''
windows-sdk-version3 string ''
windows-sdk-version4 string ''
generate-build-number boolean true
fetch-depth number 0
conventional-commits-publish-conditions boolean true
project-path string ''
additional-project-path string ''
configuration string 'Release'
use-msbuild boolean false
vs-prerelease boolean true
run-tests boolean true
asset-path1 string ''
asset-path2 string ''
asset-path3 string ''
asset-name1 string ''
asset-name2 string ''
asset-name3 string ''
asset-content-type1 string 'application/x-msi'
asset-content-type2 string 'application/x-msi'
asset-content-type3 string 'application/x-msi'
deploy-web-assembly-path string ''
deploy-web-assembly-repo string ''

Secrets

name type default
personal-token string ''

Contacts