diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..44f3dd8 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/Directory.Build.props b/Directory.Build.props index 58952c1..4f7b8ba 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,12 +4,13 @@ true true - AGPL-3.0-or-later - https://github.com/VMelnalksnis/Gnomeshade + Apache-2.0 + https://github.com/VMelnalksnis/NordigenDotNet git Valters Melnalksnis - Gnomeshade + Valters Melnalksnis + en-US diff --git a/NordigenDotNet.sln b/NordigenDotNet.sln index f3d7f00..805e78a 100644 --- a/NordigenDotNet.sln +++ b/NordigenDotNet.sln @@ -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 diff --git a/deployment/publish.sh b/deployment/publish.sh new file mode 100644 index 0000000..2fecbc3 --- /dev/null +++ b/deployment/publish.sh @@ -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" diff --git a/source/VMelnalksnis.NordigenDotNet.DependencyInjection/VMelnalksnis.NordigenDotNet.DependencyInjection.csproj b/source/VMelnalksnis.NordigenDotNet.DependencyInjection/VMelnalksnis.NordigenDotNet.DependencyInjection.csproj index b46b7be..1b8f214 100644 --- a/source/VMelnalksnis.NordigenDotNet.DependencyInjection/VMelnalksnis.NordigenDotNet.DependencyInjection.csproj +++ b/source/VMelnalksnis.NordigenDotNet.DependencyInjection/VMelnalksnis.NordigenDotNet.DependencyInjection.csproj @@ -2,6 +2,14 @@ net6.0 + + VMelnalksnis.NordigenDotNet.DependencyInjection + VMelnalksnis.NordigenDotNet.DependencyInjection + Dependency injection configuration for VMelnalksnis.NordigenDotNet + nordigen + true + true + snupkg diff --git a/source/VMelnalksnis.NordigenDotNet/VMelnalksnis.NordigenDotNet.csproj b/source/VMelnalksnis.NordigenDotNet/VMelnalksnis.NordigenDotNet.csproj index a69c600..a0ceb72 100644 --- a/source/VMelnalksnis.NordigenDotNet/VMelnalksnis.NordigenDotNet.csproj +++ b/source/VMelnalksnis.NordigenDotNet/VMelnalksnis.NordigenDotNet.csproj @@ -2,6 +2,14 @@ net6.0 + + VMelnalksnis.NordigenDotNet + VMelnalksnis.NordigenDotNet + .NET API client for Nordigen + nordigen + true + true + snupkg diff --git a/version b/version new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/version @@ -0,0 +1 @@ +0.1.0