-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from s2quake/ci/improve-ci
Add github action on push tag
- Loading branch information
Showing
5 changed files
with
78 additions
and
21 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,11 @@ | ||
#!/usr/local/bin/pwsh | ||
param ( | ||
[string]$OutputPath, | ||
[int]$PullRequestNumber, | ||
[string]$KeyPath | ||
) | ||
|
||
.github/scripts/pack.ps1 ` | ||
-OutputPath $OutputPath ` | ||
-PullRequestNumber $PullRequestNumber ` | ||
-KeyPath $KeyPath |
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,29 @@ | ||
#!/usr/local/bin/pwsh | ||
param ( | ||
[string]$OutputPath, | ||
[string]$KeyPath, | ||
[string]$NugetApiKey | ||
) | ||
|
||
$commitMessage = "$(git log -1 --pretty=%B)" | ||
$pattern = "(?<=Merge pull request #)(\d+)" | ||
if (!($commitMessage -match $pattern)) { | ||
Write-Error "Commit message does not contain a pull request number." | ||
} | ||
|
||
Remove-Item -Force -Recurse pack -ErrorAction SilentlyContinue | ||
|
||
$commitSHA = "$(git log -1 --pretty=%H)" | ||
.github/scripts/pack.ps1 ` | ||
-OutputPath $OutputPath ` | ||
-PullRequestNumber $matches[1] ` | ||
-KeyPath $KeyPath ` | ||
-CommitSHA $commitSHA | ||
|
||
Get-ChildItem -Path $OutputPath -Filter "*.nupkg" | ForEach-Object { | ||
dotnet nuget push ` | ||
$_ ` | ||
--skip-duplicate ` | ||
--api-key $NugetApiKey ` | ||
--source https://api.nuget.org/v3/index.json | ||
} |
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,24 @@ | ||
#!/usr/local/bin/pwsh | ||
param ( | ||
[string]$OutputPath, | ||
[string]$KeyPath, | ||
[string]$NugetApiKey, | ||
[string]$tagName | ||
) | ||
|
||
Remove-Item -Force -Recurse pack -ErrorAction SilentlyContinue | ||
|
||
.github/scripts/pack.ps1 ` | ||
-OutputPath $OutputPath ` | ||
-KeyPath $KeyPath ` | ||
-CommitSHA $tagName | ||
|
||
$files = Get-ChildItem -Path pack -Filter "*.nupkg" | ForEach-Object { | ||
dotnet nuget push ` | ||
$_ ` | ||
--api-key $NugetApiKey ` | ||
--source https://api.nuget.org/v3/index.json | ||
$_.FullName | ||
} | ||
|
||
gh release create --generate-notes --latest --title "Release $tagName" $tagName $files |
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
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