Skip to content

Commit

Permalink
Merge pull request #13 from Lombiq/issue/OSOE-136
Browse files Browse the repository at this point in the history
OSOE-136: Automate GitHub releases
  • Loading branch information
sarahelsaig authored Jun 20, 2022
2 parents a5c2c6a + e1b85d9 commit c3c934a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ jobs:
# * -p:NuGetBuild=true is our property to load Lombiq dependencies from NuGet by switching project references
# to package references.
# * -p:GenerateDocumentationFile=True is for generating XML doc files. Needed both for build and pack. It'd
# cause CS* warnings but we hande that centrally from .NET Analyzers so disabling them here.
# cause CS* warnings but we handle that centrally from .NET Analyzers so disabling them here.
# * VSTHRD* rules come from somewhere unknown, disabling them.
# * -p:EnableNETAnalyzers=false is to disable further .NET analyzer we don't need here.
# * -p:ContinuousIntegrationBuild=true is needed for Deterministic Builds:
# https://github.com/clairernovotny/DeterministicBuilds.
# * -p:DebugSymbols=true and -p:DebugType=portable are needed to generate PDB files.
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=true -p:LangVersion=Latest -p:GenerateDocumentationFile=True -p:NoWarn=CS1573%3BCS1591%3BVSTHRD002%3BVSTHRD200 -p:EnableNETAnalyzers=false -p:ContinuousIntegrationBuild=true -p:DebugSymbols=true -p:DebugType=portable --verbosity ${{ inputs.verbosity }}

- name: Pack
# Notes on the configuration apart from what's also for dotnet build:
# * NoWarn on NU5104 to not have warnings for prerelease dependencies, see:
Expand All @@ -180,11 +181,24 @@ jobs:
# * -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg are needed to generate symbol packages:
# https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg.
run: dotnet pack --output artifacts --configuration Release --no-restore --no-build -p:NuGetBuild=true -p:Version=${{ steps.get-version.outputs.VERSION }} -p:GenerateDocumentationFile=True -p:NoWarn=NU5104 -p:TreatWarningsAsErrors=true -warnaserror -p:WarnOnPackingNonPackableProject=True -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:NoDefaultExcludes=true --verbosity ${{ inputs.verbosity }}

- name: Push with dotnet
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.API_KEY }} --source ${{ steps.source-value.outputs.value }} --skip-duplicate

- name: Archive artifacts
- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: NuGet-Package
path: artifacts

# This is not in its own action becasuse it's all very specific to this NuGet publishing workflow.
- name: Create Release
# v1.10.0
uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37
# This is to prevent creating releases when pushing tags for issue-specific pre-releases like
# v4.3.1-alpha.osoe-86.
if: "!contains(github.ref, '-')"
with:
allowUpdates: true
generateReleaseNotes: true
artifacts: artifacts/*.nupkg, artifacts/*.snupkg

0 comments on commit c3c934a

Please sign in to comment.