feat(build): Publish NuGet package
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags: [ v*.*.* ]
|
||||
|
||||
jobs:
|
||||
build-artifacts:
|
||||
strategy:
|
||||
matrix:
|
||||
project:
|
||||
- Gnomeshade.Interfaces.Desktop
|
||||
- Gnomeshade.Interfaces.WebApi
|
||||
- Gnomeshade.Interfaces.Desktop
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOTNET_NOLOGO: true
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v2.1.0
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
|
||||
- run: chmod +x deployment/publish.sh
|
||||
|
||||
- name: Publish project
|
||||
id: publish
|
||||
run: >
|
||||
deployment/publish.sh
|
||||
"${{ matrix.project }}"
|
||||
"${{ github.run_number }}"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ steps.publish.outputs.artifact-name }}
|
||||
path: ${{ steps.publish.outputs.artifact }}
|
||||
|
||||
create-release:
|
||||
name: Create release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
id: download
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v0.1.14
|
||||
with:
|
||||
draft: true
|
||||
prerelease: false
|
||||
tag_name: ${{ github.ref_name }}
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
files: |
|
||||
${{ steps.download.outputs.download-path }}/**/*.zip
|
||||
|
||||
- name: NuGet Push
|
||||
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
|
||||
working-directory: ${{ steps.download.outputs.download-path }}
|
||||
@@ -4,12 +4,13 @@
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseExpression>AGPL-3.0-or-later</PackageLicenseExpression>
|
||||
<RepositoryUrl>https://github.com/VMelnalksnis/Gnomeshade</RepositoryUrl>
|
||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||
<RepositoryUrl>https://github.com/VMelnalksnis/NordigenDotNet</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
|
||||
<Copyright>Valters Melnalksnis</Copyright>
|
||||
<Product>Gnomeshade</Product>
|
||||
<Authors>Valters Melnalksnis</Authors>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
Directory.Build.props = Directory.Build.props
|
||||
stylecop.json = stylecop.json
|
||||
.editorconfig = .editorconfig
|
||||
version = version
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VMelnalksnis.NordigenDotNet", "source\VMelnalksnis.NordigenDotNet\VMelnalksnis.NordigenDotNet.csproj", "{C70F5B40-0A36-45CB-921B-09EA1F9A63AD}"
|
||||
@@ -29,6 +30,7 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{F733A567-775B-4DD8-B900-005894E062B5}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\workflows\test.yml = .github\workflows\test.yml
|
||||
.github\workflows\release.yml = .github\workflows\release.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
version=$(cat version)
|
||||
publish_dir="./source/$1/bin/Release"
|
||||
package_name="$1.$version.nupkg"
|
||||
|
||||
dotnet pack \
|
||||
./source/"$1"/"$1".csproj \
|
||||
--configuration Release \
|
||||
-p:AssemblyVersion="$version"."$2" \
|
||||
-p:AssemblyFileVersion="$version"."$2" \
|
||||
-p:PackageVersion="$version"."$2" \
|
||||
-p:InformationalVersion="$version""$3" \
|
||||
/warnAsError \
|
||||
/nologo
|
||||
|
||||
echo "::set-output name=artifact-name::$package_name"
|
||||
echo "::set-output name=artifact::$publish_dir/$package_name"
|
||||
+8
@@ -2,6 +2,14 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
<Product>VMelnalksnis.NordigenDotNet.DependencyInjection</Product>
|
||||
<ProductId>VMelnalksnis.NordigenDotNet.DependencyInjection</ProductId>
|
||||
<Description>Dependency injection configuration for VMelnalksnis.NordigenDotNet</Description>
|
||||
<PackageTags>nordigen</PackageTags>
|
||||
<IsPackable>true</IsPackable>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
<Product>VMelnalksnis.NordigenDotNet</Product>
|
||||
<ProductId>VMelnalksnis.NordigenDotNet</ProductId>
|
||||
<Description>.NET API client for Nordigen</Description>
|
||||
<PackageTags>nordigen</PackageTags>
|
||||
<IsPackable>true</IsPackable>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user