Skip to content

Commit

Permalink
Retire BuildNumber, BranchSpec and PullReuqestBase, inject `Git…
Browse files Browse the repository at this point in the history
…HubActions`
  • Loading branch information
IT-VBFK committed Jan 11, 2023
1 parent 01bf49d commit 1725cc0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- name: Run NUKE
run: ./build.ps1
env:
BranchSpec: ${{ github.ref }}
BuildNumber: ${{ github.run_number }}
PullRequestBase: ${{ github.event.pull_request.base.ref }}
ApiKey: ${{ secrets.NUGETAPIKEY }}

- name: coveralls
Expand Down
12 changes: 0 additions & 12 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
"type": "string",
"description": "The key to push to Nuget"
},
"BranchSpec": {
"type": "string",
"description": "A branch specification such as develop or refs/pull/1775/merge"
},
"BuildNumber": {
"type": "string",
"description": "An incrementing build number as provided by the build engine"
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
Expand Down Expand Up @@ -66,10 +58,6 @@
"type": "string"
}
},
"PullRequestBase": {
"type": "string",
"description": "The target branch for the pull request"
},
"Root": {
"type": "string",
"description": "Root directory during build execution"
Expand Down
13 changes: 7 additions & 6 deletions Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using LibGit2Sharp;
using Nuke.Common;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.IO;
Expand Down Expand Up @@ -32,14 +33,14 @@ class Build : NukeBuild

public static int Main() => Execute<Build>(x => x.SpellCheck, x => x.Push);

[Parameter("A branch specification such as develop or refs/pull/1775/merge")]
readonly string BranchSpec;
GitHubActions GitHubActions => GitHubActions.Instance;

[Parameter("An incrementing build number as provided by the build engine")]
readonly string BuildNumber;
string BranchSpec => GitHubActions?.Ref;
string BuildNumber => GitHubActions?.RunNumber.ToString();
string PullRequestBase => GitHubActions?.BaseRef;

[Parameter("The target branch for the pull request")]
readonly string PullRequestBase;
[Parameter]
readonly string GithubToken;

[Parameter("The key to push to Nuget")]
readonly string ApiKey;
Expand Down

0 comments on commit 1725cc0

Please sign in to comment.