-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
publish.ps1
31 lines (23 loc) · 885 Bytes
/
publish.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
param([string] $PSGalleryApiKey)
$changes = git status -s
if ($LASTEXITCODE -ne 0 -or $changes) {
throw "Are there changes in your repo?"
}
if (Test-Path $PSScriptRoot/tmp) {
Remove-Item -Path $PSScriptRoot/tmp -Recurse -Force
}
Copy-Item -Path (Get-Item -Path .\* -Exclude ".git").FullName -Destination $PSScriptRoot/tmp/Assert -Recurse -Force -Exclude .git
Push-Location $PSScriptRoot/tmp/Assert
Remove-Item -Path @(
".vscode"
"doc"
"tst"
) -Recurse -Confirm:$false -Force
Get-Item publish.ps1 | Remove-Item -Force
Get-ChildItem -Filter *.MD -Recurse | Remove-Item -Force
Get-ChildItem -Filter *.Tests.ps1 -Recurse | Remove-Item -Force
Get-ChildItem -Filter *.yml | Remove-Item -Force
Get-ChildItem -Filter *.xml | Remove-Item -Force
Get-ChildItem -Filter .gitignore | Remove-Item -Force
Publish-Module -Path . -NuGetApiKey $PSGalleryApiKey
Pop-Location