-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automation for publishing / uploading
- Loading branch information
1 parent
12fbf48
commit 4d41557
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
param ( | ||
$SolutionRoot = "$PSScriptRoot\.." | ||
) | ||
|
||
$NugetAPI = Get-Content -Raw -LiteralPath "C:\Support\Important\NugetOrg.txt" | ||
#$GitHubAPI = Get-Content -Raw -LiteralPath "C:\Support\Important\GithubAPI.txt" | ||
|
||
$ReleasePath = [io.path]::Combine($SolutionRoot, "OfficeIMO.Word", "bin", "Release") | ||
$File = Get-ChildItem -Path $ReleasePath -Recurse -Filter "*.nupkg" | ||
|
||
# publish to nuget.org | ||
if ($File.Count -eq 1) { | ||
dotnet nuget push $File.FullName --api-key $NugetAPI --source https://api.nuget.org/v3/index.json | ||
|
||
#dotnet nuget add source --username evotecit --password $GitHubAPI --store-password-in-clear-text --name github "https://nuget.pkg.github.com/OWNER/index.json" | ||
#dotnet nuget push $File.FullName --api-key $GitHubAPI --source "github" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
param ( | ||
$SolutionRoot = "$PSScriptRoot\.." | ||
) | ||
|
||
$GitHubAccessToken = Get-Content -Raw 'C:\Support\Important\GithubAPI.txt' | ||
$UserName = 'EvotecIT' | ||
$GitHubRepositoryName = 'OfficeIMO' | ||
|
||
$SolutionPath = [io.path]::Combine($SolutionRoot, 'OfficeImo.sln') | ||
if (-not $SolutionRoot -or -not (Test-Path -Path $SolutionPath)) { | ||
Write-Host -Object "Solution not found at $SolutionPath" -ForegroundColor Red | ||
return | ||
} | ||
|
||
$ProjectPath = [io.path]::Combine($SolutionRoot, "OfficeIMO.Word", "OfficeIMO.Word.csproj") | ||
|
||
[xml] $XML = Get-Content -Raw $ProjectPath | ||
|
||
$Version = $XML.Project.PropertyGroup[0].VersionPrefix | ||
|
||
$ZipPath = [io.path]::Combine($SolutionRoot, "OfficeIMO.Word", "bin", "Release", "OfficeIMO.Word.$Version.zip") | ||
$IsPreRelease = $false | ||
$TagName = "v$Version" | ||
|
||
if (Test-Path -LiteralPath $ZipPath) { | ||
$sendGitHubReleaseSplat = @{ | ||
GitHubUsername = $UserName | ||
GitHubRepositoryName = $GitHubRepositoryName | ||
GitHubAccessToken = $GitHubAccessToken | ||
TagName = $TagName | ||
AssetFilePaths = $ZipPath | ||
IsPreRelease = $IsPreRelease | ||
} | ||
$StatusGithub = Send-GitHubRelease @sendGitHubReleaseSplat | ||
$StatusGithub | ||
} |