Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace bat files with NUKE build #3682

Merged
merged 2 commits into from
Nov 4, 2021
Merged

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Oct 28, 2021

While getting Fluid to build I was once again faced with all sorts of build script problems, like location of MSBuild/Visual Studio etc (required VS developer command prompt to have PATH right).

NUKE allows you to create build script using plain C# with great API and reduced risk of typos. Library also gives you full power of C# (loops, functions, encapsulation, variables and typing). It's really easy to adopt if you know C#.

What I offer with this PR:

  • new solution project _build.csproj
  • all build logic neatly in Build.cs, should be quite readable
  • transform build\*.bat files to call relevant NUKE targets, new targets in Build.cs contain the old bat file logic
  • build.cmd and build.sh at repository root, easy to get started (Linux build possibility!)

FUTURE

  • NUKE can generate appveyor, github actions, teamcity etc CI configurations if needed, no need to fight YAML
    • same targets can be invoked with appveyor, azure devops and github actions
  • build on linux (needs some tweaks for targets / ignores), I've done this with multiple projects
  • this will also benefit Improve build and reduce warnings #3437 and Replace DotLiquid with Fluid #3679

Targets can be invoked using Windows command line with build.cmd (default compile), build.cmd unittest (UnitTests.bat functionality), configuration is automatically Release in CI environment (not a local build).

@lahma lahma marked this pull request as ready for review October 28, 2021 12:10
@lahma
Copy link
Collaborator Author

lahma commented Oct 28, 2021

@RicoSuter do you think we could change like this in as part of larger changes that are currently in motion. This would modernize and enable new scenarios, like testing on Linux.

@lahma
Copy link
Collaborator Author

lahma commented Nov 3, 2021

I've added basic sample how to add GitHub actions workflow generation (Build.CI.GitHubActions.cs), now pr and build, could add different rules and invocations like "push to preview MyGet on master build", could probably also add release workflow that is only triggered when tags are being created.

I'm afraid I cannot test these as these require a bit more permissions in the repo for GitHub to allow running such code.

@RicoSuter
Copy link
Owner

Ok, ill have a look. Can i merge this PR and then continue with that?

@lahma
Copy link
Collaborator Author

lahma commented Nov 4, 2021

Yes please, ping me if there's anything problematic you find.

@lahma
Copy link
Collaborator Author

lahma commented Nov 4, 2021

The GitHub actions should light up after the merge, normal contributors cannot trigger workflow changes via PRs as it's a security risk.

@RicoSuter RicoSuter merged commit d5ac483 into RicoSuter:master Nov 4, 2021
@lahma lahma deleted the nuke-build branch November 4, 2021 11:33
@lahma
Copy link
Collaborator Author

lahma commented Nov 4, 2021

@RicoSuter I've pushed couple PRs to fix two issues found by CI runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants