https://github.com/poshcode/tasks
Shared Invoke-Build Tasks ...
https://github.com/poshcode/tasks
Last synced: 8 months ago
JSON representation
Shared Invoke-Build Tasks ...
- Host: GitHub
- URL: https://github.com/poshcode/tasks
- Owner: PoshCode
- Created: 2023-10-19T04:29:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-10T06:47:52.000Z (11 months ago)
- Last Synced: 2025-04-08T19:46:58.035Z (9 months ago)
- Language: PowerShell
- Size: 69.3 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Opinionated Build Tasks for Invoke-Build
- Requires PowerShell 7.2 or later.
- Should work with any module from my [PowerShellTemplate](/jaykul/PowerShellTemplate).
I've started using Invoke-Build to run my builds in PowerShell (due mostly to unhappiness with GitHub and Azure Pipelines).
This is a collection of tasks I've written that get shared by all my project builds.
## Usage
Your .build.ps1 script _must_ set variables:
### For PowerShell modules
- `$PSModuleName`
- The name of the module you're building.
- There **must** be a .psd1 module manifest with this name in your source.
- The build will create a folder with this name in the output folder
If you're including building a dotnet project, it's also recommended to set
- `$DotNetPublishRoot`
- The target folder for dotnet publish.
- Defaults to `$OutputRoot/publish`
- For PowerShell modules, I always override this to `$BuildRoot/lib` and add that to the `CopyDirectories` list
in my ModuleBuilder `build.psd1` so that it gets copied to the output folder by ModuleBuilder.
### For DotNet assemblies
- `$dotnetProjects`
- Specifies which projects to build
- I recommend you put this as a parameter on your Build.ps1
- Set the default to the full list of your assembly projects
- Add an alias: "Projects"
- `$dotnetTestProjects`
- Specifies which projects are test projects
- I recommend you put this as a parameter on your Build.ps1
- Add an alias: "TestProjects"
- `$dotnetOptions`
- Specifies further options to pass to dotnet
- I recommend you put this as a parameter on your Build.ps1
- Add an alias: "Options"
- Example values:
"-verbosity" = "minimal"
"-runtime" = "linux-x64"