Skip to content

Commit

Permalink
Merge pull request #1190 from shimat/publish_nuget
Browse files Browse the repository at this point in the history
GHA workflow to publish NuGet packages
  • Loading branch information
shimat authored Jan 24, 2021
2 parents 2df68fd + 16141c8 commit e26922f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish_nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ jobs:
with:
dotnet-version: '3.1.x'

- run: |
- name: Rename
run: |
for f in $(find $PWD -maxdepth 1 -regex ".+\.s?nupkg"); do
dotnet run --project tool/OpenCvSharp.NupkgBetaRemover --configuration Release -- "$f"
done
ls -l
- name: Push to nuget.org
run: |
dotnet nuget push "*.nupkg" -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push "*.snupkg" -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
2 changes: 1 addition & 1 deletion tool/OpenCvSharp.NupkgBetaRemover/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static void Main(string[] args)

foreach (var nupkgFile in args)
{
if (nupkgFile.Contains("ubuntu"))
if (!nupkgFile.Contains("-beta"))
continue;
var fileNameMatch = Regex.Match(nupkgFile, @"OpenCvSharp4\..*(?<date>\d{8})(?<beta_version>-beta\d*)\.s?nupkg");
if (!fileNameMatch.Success)
Expand Down

0 comments on commit e26922f

Please sign in to comment.