Skip to content

Commit

Permalink
Gate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Dec 30, 2023
1 parent afbe7c1 commit 071d572
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 17 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/BuildDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,52 @@ jobs:
windows-latest:
name: windows-latest
runs-on: windows-latest

permissions: write-all
environment:
name: release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: NBGV
id: nbgv
uses: dotnet/nbgv@master
with:
setAllVars: true
- run: echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}'

- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}

- name: 'Run: Compile, Deploy'
run: ./build.cmd Compile Deploy
env:
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}

- name: 'Publish: output'
uses: actions/upload-artifact@v3
with:
name: output
path: output

- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog

- name: Create Release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
body: |
${{ steps.changelog.outputs.commitLog }}
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)images\logo.png" Pack="true" PackagePath="\" />
Expand All @@ -45,7 +45,7 @@
<ItemGroup>
<!--<Compile Update="**\*.cs" DependentUpon="I%(Filename).cs" />-->
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" Condition="!Exists('packages.config')" />
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
</ItemGroup>
Expand Down
28 changes: 14 additions & 14 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
using CP.BuildTools;
using static Nuke.Common.Tools.DotNet.DotNetTasks;

[GitHubActions(
"BuildOnly",
GitHubActionsImage.WindowsLatest,
OnPushBranchesIgnore = new[] { "main" },
FetchDepth = 0,
InvokedTargets = new[] { nameof(Compile) })]
[GitHubActions(
"BuildDeploy",
GitHubActionsImage.WindowsLatest,
OnPushBranches = new[] { "main" },
FetchDepth = 0,
ImportSecrets = new[] { nameof(NuGetApiKey) },
InvokedTargets = new[] { nameof(Compile), nameof(Deploy) })]
////[GitHubActions(
//// "BuildOnly",
//// GitHubActionsImage.WindowsLatest,
//// OnPushBranchesIgnore = new[] { "main" },
//// FetchDepth = 0,
//// InvokedTargets = new[] { nameof(Compile) })]
////[GitHubActions(
//// "BuildDeploy",
//// GitHubActionsImage.WindowsLatest,
//// OnPushBranches = new[] { "main" },
//// FetchDepth = 0,
//// ImportSecrets = new[] { nameof(NuGetApiKey) },
//// InvokedTargets = new[] { nameof(Compile), nameof(Deploy) })]
class Build : NukeBuild
{
/// Support plugins are available for:
Expand Down Expand Up @@ -58,7 +58,7 @@ class Build : NukeBuild
PackagesDirectory.CreateOrCleanDirectory();
await this.UpdateVisualStudio();
await this.InstallDotNetSdk("3.1.x", "5.x.x", "6.x.x", "7.x.x");
await this.InstallDotNetSdk("6.x.x", "7.x.x", "8.x.x");
this.InstallAspNetCore("6.0");
this.InstallAspNetCore("7.0");
});
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"sdk": {
"version": "7.0.400"
"version": "8.0.10",
"rollForward": "latestFeature"
}
}

0 comments on commit 071d572

Please sign in to comment.