Skip to content

Commit

Permalink
Merge pull request #4 from pavel-zhur/feature/packable-projects
Browse files Browse the repository at this point in the history
Feature/packable projects
  • Loading branch information
pavel-zhur authored Jun 7, 2024
2 parents 71bb5de + e4d14ab commit ca492cf
Show file tree
Hide file tree
Showing 59 changed files with 370 additions and 96 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/microservices.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: microservices

on:
# Triggers the workflow on push or pull request events but only for the master branch
#push:
#branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# - name: Wasm tools
# run: dotnet workload install wasm-tools
- name: Remove Frontend.Web (speedup)
run: dotnet sln remove OneShelf.Frontend/OneShelf.Frontend.Web
- name: Remove Frontend.Web.Tests (speedup)
run: dotnet sln remove OneShelf.Frontend/OneShelf.Frontend.Web.Tests
- name: Restore dependencies
run: dotnet restore
# - name: Build
# run: dotnet build --no-restore --configuration Release
- name: Publish 1
run: dotnet publish OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/OneShelf.Telegram.Runner.Functions.csproj --no-restore
- name: Publish 2
run: dotnet publish OneShelf.OneDog/OneShelf.OneDog.Runner.Functions/OneShelf.OneDog.Runner.Functions.csproj --no-restore
- name: Publish 3
run: dotnet publish OneShelf.Frontend/OneShelf.Frontend.Api/OneShelf.Frontend.Api.csproj --no-restore
- name: Publish 4
run: dotnet publish OneShelf.Authorization/OneShelf.Authorization.Api/OneShelf.Authorization.Api.csproj --no-restore
- name: Publish 5
run: dotnet publish HarmonyDB.Index/HarmonyDB.Index.Api/HarmonyDB.Index.Api.csproj --no-restore
- name: Publish 6
run: dotnet publish OneShelf.Illustrations/OneShelf.Illustrations.Api/OneShelf.Illustrations.Api.csproj --no-restore
- name: Publish 7
run: dotnet publish OneShelf.Billing/OneShelf.Billing.Api/OneShelf.Billing.Api.csproj --no-restore
- name: Publish 8
run: dotnet publish OneShelf.Pdfs/OneShelf.Pdfs.Api/OneShelf.Pdfs.Api.csproj --no-restore --configuration Release
- name: Publish 9
run: dotnet publish OneShelf.Collectives/OneShelf.Collectives.Api/OneShelf.Collectives.Api.csproj --no-restore
- name: Publish 10
run: dotnet publish OneShelf.Sources/OneShelf.Sources.Self.Api/OneShelf.Sources.Self.Api.csproj --no-restore
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Telegram.Runner.Functions
path: ./**/OneShelf.Telegram.Runner.Functions/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.OneDog.Runner.Functions
path: ./**/OneShelf.OneDog.Runner.Functions/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Frontend.Api
path: ./**/OneShelf.Frontend.Api/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Authorization.Api
path: ./**/OneShelf.Authorization.Api/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: HarmonyDB.Index.Api
path: ./**/HarmonyDB.Index.Api/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Illustrations.Api
path: ./**/OneShelf.Illustrations.Api/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Billing.Api
path: ./**/OneShelf.Billing.Api/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Pdfs.Api
path: ./**/OneShelf.Pdfs.Api/bin/Release/net6.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Collectives.Api
path: ./**/OneShelf.Collectives.Api/bin/Release/net8.0/publish
- uses: actions/upload-artifact@v4
with:
name: OneShelf.Sources.Self.Api
path: ./**/OneShelf.Sources.Self.Api/bin/Release/net8.0/publish
# - name: Test
# run: dotnet test --no-build --verbosity normal
29 changes: 29 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: nuget

on:
# Triggers the workflow on push or pull request events but only for the master branch
#push:
#branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Pack
run: dotnet pack --include-source -p:PackageVersion=1.1.0 -p:VersionSuffix=$GITHUB_RUN_NUMBER -p:EmbedUntrackedSources=True --configuration Release --output nuget -p:Authors="Pavel Zhur" -p:Description="DO NOT USE. It is a prerelease package of the HarmonyDB / OneShelf." -p:ContinuousIntegrationBuild=True
- uses: actions/upload-artifact@v4
with:
name: packages
path: ./**/*.nupkg
6 changes: 0 additions & 6 deletions Directory.Build.props

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="readme.md" PackagePath="\readme.md" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\HarmonyDB.Common\HarmonyDB.Common\HarmonyDB.Common.csproj" />
<ProjectReference Include="..\..\OneShelf.Common\OneShelf.Common\OneShelf.Common.csproj" />
</ItemGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>

</Project>
14 changes: 10 additions & 4 deletions HarmonyDB.Common/HarmonyDB.Common/HarmonyDB.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="readme.md" PackagePath="\readme.md" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="nuget readme.md" PackagePath="\readme.md" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="System.Memory.Data" Version="8.0.0" />
</ItemGroup>

Expand All @@ -18,8 +24,5 @@
<ProjectReference Include="..\..\HarmonyDB.Common\HarmonyDB.Common.Representations.OneShelf\HarmonyDB.Common.Representations.OneShelf.csproj" />
</ItemGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="nuget readme.md" PackagePath="\readme.md" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\HarmonyDB.Common\HarmonyDB.Common\HarmonyDB.Common.csproj" />
<ProjectReference Include="..\..\OneShelf.Authorization\OneShelf.Authorization.Api.Model\OneShelf.Authorization.Api.Model.csproj" />
Expand All @@ -14,8 +23,5 @@
<ProjectReference Include="..\..\HarmonyDB.Sources\HarmonyDB.Sources.Api.Model\HarmonyDB.Sources.Api.Model.csproj" />
</ItemGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="nuget readme.md" PackagePath="\readme.md" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\HarmonyDB.Sources\HarmonyDB.Sources.Api.Model\HarmonyDB.Sources.Api.Model.csproj" />
<ProjectReference Include="..\..\OneShelf.Common\OneShelf.Common.Api.Client\OneShelf.Common.Api.Client.csproj" />
</ItemGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="nuget readme.md" PackagePath="\readme.md" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\OneShelf.Authorization\OneShelf.Authorization.Api.Model\OneShelf.Authorization.Api.Model.csproj" />
<ProjectReference Include="..\..\OneShelf.Common\OneShelf.Common\OneShelf.Common.csproj" />
<ProjectReference Include="..\..\HarmonyDB.Common\HarmonyDB.Common.Representations.OneShelf\HarmonyDB.Common.Representations.OneShelf.csproj" />
</ItemGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="nuget readme.md" PackagePath="\readme.md" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\OneShelf.Authorization\OneShelf.Authorization.Api.Model\OneShelf.Authorization.Api.Model.csproj" />
</ItemGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<Target Condition="'$(PushNuget)'=='1'" Name="NugetPackAutoVersioning" AfterTargets="Build">
<Exec Command="dotnet pack -p:PackageVersion=1.0.$(OneShelfVersion) --include-source --include-symbols --no-build --configuration $(Configuration) --output &quot;..\\..\\nuget&quot;" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget readme.md" Pack="true" Link="nuget readme.md" PackagePath="\readme.md" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
Expand Down
Loading

0 comments on commit ca492cf

Please sign in to comment.