Skip to content

Commit

Permalink
Consolidate build logic and fix nightly worklflow (dapr#170)
Browse files Browse the repository at this point in the history
This commit updates the build logic for the apps, relying on a
common place for package version definition. This lets us update it
easier in the future. This also changes the nightly workflow to match
what it is in dapr/dapr as we should be able to pick up go version
changes automatically with it.

Signed-off-by: halspang <halspang@microsoft.com>
  • Loading branch information
halspang authored Apr 12, 2023
1 parent aa1fdc4 commit 11bbf60
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 45 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/dapr-longhaul-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
name: update dapr runtime
runs-on: ubuntu-latest
env:
GOVER: 1.20
KUBECTLVER: v1.19.3
GOOS: linux
GOARCH: amd64
Expand All @@ -50,16 +49,16 @@ jobs:
run: |
echo "DAPR_CONTAINER_LOG_PATH=$GITHUB_WORKSPACE/container_logs/${{ matrix.target_os }}_${{ matrix.target_arch }}" | sed 's/\\/\//g' >> $GITHUB_ENV
shell: bash
- name: Set up Go ${{ env.GOVER }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Checkout dapr/dapr
uses: actions/checkout@v2
with:
repository: ${{ env.DAPR_CHECKOUT_REPO }}
ref: ${{ env.DAPR_CHECKOUT_REF }}
path: dapr
- name: Set up Go ${{ env.GOVER }}
uses: actions/setup-go@v3
with:
go-version-file: "dapr/go.mod"
- name: Checkout dapr/test-infra
uses: actions/checkout@v2
with:
Expand Down
11 changes: 11 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<!--
Use this property for convenience to build a path starting from the root of the repository.
-->
<EnlistmentRoot>$(MSBuildThisFileDirectory.TrimEnd('\\'))</EnlistmentRoot>

<DefaultTargetFramework>net7.0</DefaultTargetFramework>

</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<ItemGroup>
<PackageVersion Include="Dapr.Client" Version="1.10.0" />
<PackageVersion Include="Dapr.AspNetCore" Version="1.10.0" />
<PackageVersion Include="Dapr.Actors.AspNetCore" Version="1.10.0" />
<PackageVersion Include="prometheus-net" Version="3.5.0" />
</ItemGroup>
</Project>
12 changes: 9 additions & 3 deletions all.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29911.84
# Visual Studio Version 17
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "feed-generator", "feed-generator\feed-generator.csproj", "{C0633154-38FD-4A00-A056-D7180DD3E7C9}"
EndProject
Expand All @@ -19,7 +19,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "common", "common\common.csp
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{73242B78-3C8C-4A5B-B312-9056A1167DBC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pubsub-workflow", "pubsub-workflow\pubsub-workflow.csproj", "{571AD477-1187-4E27-9ADB-CDD6E7370E8C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "pubsub-workflow", "pubsub-workflow\pubsub-workflow.csproj", "{571AD477-1187-4E27-9ADB-CDD6E7370E8C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AD2D15F4-0976-4C83-AB90-20D60DFFDD43}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion common/common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions feed-generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# ------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 3000 9988

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
8 changes: 5 additions & 3 deletions feed-generator/feed-generator.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.AspNetCore" />
<PackageReference Include="prometheus-net" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions hashtag-actor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# ------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
8 changes: 5 additions & 3 deletions hashtag-actor/hashtag-actor.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<RootNamespace>Dapr.Tests.HashTagApp</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.Actors.AspNetCore" />
<PackageReference Include="prometheus-net" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions hashtag-counter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# ------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
8 changes: 5 additions & 3 deletions hashtag-counter/hashtag-counter.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<RootNamespace>Dapr.Tests.HashTagCounter</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.Actors.AspNetCore" />
<PackageReference Include="prometheus-net" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions message-analyzer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# -

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
8 changes: 5 additions & 3 deletions message-analyzer/message-analyzer.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.AspNetCore" />
<PackageReference Include="prometheus-net" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions pubsub-workflow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# ------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 3000 9988

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
12 changes: 12 additions & 0 deletions pubsub-workflow/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"profiles": {
"pubsub-workflow": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:50304;http://localhost:50305"
}
}
}
8 changes: 5 additions & 3 deletions pubsub-workflow/pubsub-workflow.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.AspNetCore" />
<PackageReference Include="prometheus-net" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions snapshot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# ------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
10 changes: 6 additions & 4 deletions snapshot/snapshot.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<UserSecretsId>054b86fc-ba82-49dc-a816-4887a9c62d33</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>.</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="Dapr.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.Actors.AspNetCore" />
<PackageReference Include="Dapr.AspNetCore" />
<PackageReference Include="prometheus-net" />

</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions validation-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the MIT License.
# ------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY . ./
Expand Down
8 changes: 5 additions & 3 deletions validation-worker/validation-worker.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.10.0-rc03" />
<PackageReference Include="prometheus-net" Version="3.5.0" />
<PackageReference Include="Dapr.AspNetCore" />
<PackageReference Include="prometheus-net" />
</ItemGroup>

</Project>

0 comments on commit 11bbf60

Please sign in to comment.