Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
51 changes: 29 additions & 22 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,55 @@
name: .NET Build, Test, and Publish Nuget Package
name: .NET Build, Test, and Publish NuGet Package

on:
push:
branches:
- "**"
tags:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- "**"

permissions:
contents: read
packages: write

env:
VERSION: 0.0.0

defaults:
run:
working-directory: ./

jobs:
build:
build-test-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v2

- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x
8.0.x
- name: Restore dependencies
dotnet-version: '10.0.x'
dotnet-quality: 'preview'

- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore --verbosity normal /p:Version=$VERSION
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: pack nuget packages
run: dotnet pack --configuration Release --output nupkgs --no-restore --no-build --verbosity normal /p:PackageVersion=$VERSION
- name: upload nuget package
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

- name: Build (net8.0 + net10.0)
run: dotnet build -c Release --no-restore /p:Version=$VERSION

- name: Test (all TFMs)
run: dotnet test -c Release --no-build

- name: Pack & Publish
if: ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') }}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet pack -c Release --no-build -o nupkgs /p:PackageVersion=$VERSION
dotnet nuget push nupkgs/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json

1 change: 0 additions & 1 deletion DynamoDBGenerator.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamoDBGenerator.SourceGenerator", "src\DynamoDBGenerator.SourceGenerator\DynamoDBGenerator.SourceGenerator.csproj", "{648B1DF4-9684-4422-95F5-74BB89862E4D}"
EndProject
Expand Down
10 changes: 8 additions & 2 deletions samples/Configuration/Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>


<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DynamoDBGenerator.SourceGenerator\DynamoDBGenerator.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\..\src\DynamoDBGenerator\DynamoDBGenerator.csproj"/>
Expand Down
8 changes: 7 additions & 1 deletion samples/Initialisation/Initialisation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DynamoDBGenerator.SourceGenerator\DynamoDBGenerator.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\..\src\DynamoDBGenerator\DynamoDBGenerator.csproj"/>
Expand Down
7 changes: 6 additions & 1 deletion samples/KeyConversion/KeyConversion.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DynamoDBGenerator.SourceGenerator\DynamoDBGenerator.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DynamoDBGenerator.SourceGenerator\DynamoDBGenerator.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
Expand Down
7 changes: 6 additions & 1 deletion samples/TypeSupport/TypeSupport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DynamoDBGenerator.SourceGenerator\DynamoDBGenerator.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" PrivateAssets="all"/>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFrameworkVersion)' == 'v8.0'">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp"
Version="4.14.0"
PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFrameworkVersion)' != 'v8.0'">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp"
Version="5.0.0"
PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<!-- Is required in order to pack the analyzer correctly with NuGet -->
<None Include="$(OutputPath)\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false"/>
</ItemGroup>


</Project>
7 changes: 6 additions & 1 deletion src/DynamoDBGenerator/DynamoDBGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPackable>true</IsPackable>
<PackageVersion>0.0.0</PackageVersion>
Expand All @@ -16,6 +15,12 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="4.0.10.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="5.0.0-preview0012" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NuGetAudit>false</NuGetAudit>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' >= '10.0.0'">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="5.0.0-preview0012" />
Expand Down
Loading