mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Should deploy now
This commit is contained in:
parent
cf8c474ba8
commit
8e6ff8691b
2 changed files with 40 additions and 5 deletions
1
README.md
Normal file
1
README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
[](https://ci.appveyor.com/project/snazy2000/snipeitps)
|
||||||
|
|
@ -134,12 +134,12 @@ task GenerateRelease CreateHelp, {
|
||||||
# Copy module
|
# Copy module
|
||||||
Copy-Item -Path "$BuildRoot\SnipeitPS\*" -Destination "$releasePath\SnipeitPS" -Recurse -Force
|
Copy-Item -Path "$BuildRoot\SnipeitPS\*" -Destination "$releasePath\SnipeitPS" -Recurse -Force
|
||||||
# Copy additional files
|
# Copy additional files
|
||||||
#$additionalFiles = @(
|
$additionalFiles = @(
|
||||||
# "$BuildRoot\CHANGELOG.md"
|
"$BuildRoot\CHANGELOG.md"
|
||||||
#"$BuildRoot\LICENSE"
|
#"$BuildRoot\LICENSE"
|
||||||
#"$BuildRoot\README.md"
|
"$BuildRoot\README.md"
|
||||||
#)
|
)
|
||||||
#Copy-Item -Path $additionalFiles -Destination "$releasePath\SnipeitPS" -Force
|
Copy-Item -Path $additionalFiles -Destination "$releasePath\SnipeitPS" -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
# Synopsis: Update the manifest of the module
|
# Synopsis: Update the manifest of the module
|
||||||
|
|
@ -183,6 +183,40 @@ task ConvertMarkdown -Partial @ConvertMarkdown InstallPandoc, {process {
|
||||||
}, RemoveMarkdownFiles
|
}, RemoveMarkdownFiles
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
|
# region publish
|
||||||
|
task Deploy -If (
|
||||||
|
# Only deploy if the master branch changes
|
||||||
|
$env:APPVEYOR_REPO_BRANCH -eq 'master' -and
|
||||||
|
# Do not deploy if this is a pull request (because it hasn't been approved yet)
|
||||||
|
(-not ($env:APPVEYOR_PULL_REQUEST_NUMBER)) -and
|
||||||
|
# Do not deploy if the commit contains the string "skip-deploy"
|
||||||
|
# Meant for major/minor version publishes with a .0 build/patch version (like 2.1.0)
|
||||||
|
$env:APPVEYOR_REPO_COMMIT_MESSAGE -notlike '*skip-deploy*'
|
||||||
|
) {
|
||||||
|
Remove-Module SnipeitPS -ErrorAction SilentlyContinue
|
||||||
|
}, PublishToGallery
|
||||||
|
|
||||||
|
task PublishToGallery {
|
||||||
|
assert ($env:PSGalleryAPIKey) "No key for the PSGallery"
|
||||||
|
|
||||||
|
Import-Module $releasePath\SnipeitPS\SnipeitPS.psd1 -ErrorAction Stop
|
||||||
|
Publish-Module -Name SnipeitPS -NuGetApiKey $env:PSGalleryAPIKey
|
||||||
|
}
|
||||||
|
|
||||||
|
# Synopsis: Push with a version tag.
|
||||||
|
task PushRelease GitStatus, GetVersion, {
|
||||||
|
# Done in appveyor.yml with deploy provider.
|
||||||
|
# This is needed, as I don't know how to athenticate (2-factor) in here.
|
||||||
|
exec { git checkout master }
|
||||||
|
$changes = exec { git status --short }
|
||||||
|
assert (!$changes) "Please, commit changes."
|
||||||
|
|
||||||
|
exec { git push }
|
||||||
|
exec { git tag -a "v$Version" -m "v$Version" }
|
||||||
|
exec { git push origin "v$Version" }
|
||||||
|
}
|
||||||
|
# endregion
|
||||||
|
|
||||||
#region Cleaning tasks
|
#region Cleaning tasks
|
||||||
task Clean RemoveGeneratedFiles
|
task Clean RemoveGeneratedFiles
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue