Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-136: Automate GitHub releases #13

Merged
merged 8 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Verify Submodule Pull Request
name: Verify OSOCE Submodule Pull Request
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not needed, the workflow is compatible with any repo. OSOCE is only the default option for inputs.repo.


on:
workflow_call:
Expand Down