--- /dev/null
+name: CI
+
+on: [ "push", "pull_request" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-20.04
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 7.x
+
+ - name: Run the Cake script
+ uses: cake-build/cake-action@94fa55b4f83cee90f2621654eba6a056ae71df90
+ with:
+ verbosity: Diagnostic
+
+ - uses: actions/upload-artifact@v3
+ with:
+ name: nuget packages
+ path: ./*/bin/Release*/*.nupkg
+
+ - name: Push NuGet package
+ if: github.ref_type == 'tag'
+ run: |
+ dotnet nuget push ./{Hazel,Impostor.Hazel.Abstractions}/bin/Release/*.nupkg --source ${{ secrets.NUGET_SOURCE }} --api-key ${{ secrets.NUGET_KEY }}
--- /dev/null
+<Project>
+ <PropertyGroup>
+ <Authors>Impostor</Authors>
+ <PackageLicenseExpression>MIT</PackageLicenseExpression>
+ <RepositoryUrl>https://github.com/Impostor/Impostor.Hazel</RepositoryUrl>
+ <RepositoryType>git</RepositoryType>
+
+ <VersionPrefix>1.0.0</VersionPrefix>
+ <VersionSuffix>dev</VersionSuffix>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
<DefineConstants>HAZEL_BAG</DefineConstants>
<RootNamespace>Impostor.Hazel</RootNamespace>
<AssemblyName>Impostor.Hazel</AssemblyName>
+ <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
+ <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
</Project>
--- /dev/null
+var target = Argument("target", "Build");
+
+var workflow = BuildSystem.GitHubActions.Environment.Workflow;
+var buildId = workflow.RunNumber;
+var tag = workflow.RefType == GitHubActionsRefType.Tag ? workflow.RefName : null;
+
+Task("Build")
+ .Does(() =>
+{
+ var settings = new DotNetBuildSettings
+ {
+ Configuration = "Release",
+ MSBuildSettings = new DotNetMSBuildSettings(),
+ };
+
+ if (tag != null)
+ {
+ settings.MSBuildSettings.Version = tag;
+ }
+ else if (buildId != 0)
+ {
+ settings.MSBuildSettings.VersionSuffix = "ci." + buildId;
+ }
+
+ DotNetBuild(".", settings);
+});
+
+RunTarget(target);