Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

[FEATURE] Multiple Nuget Deploy, 1 Step #41

Open
houseofcat opened this issue Jul 31, 2020 · 3 comments · Fixed by Elskom/publish-nuget#1 · May be fixed by #61
Open

[FEATURE] Multiple Nuget Deploy, 1 Step #41

houseofcat opened this issue Jul 31, 2020 · 3 comments · Fixed by Elskom/publish-nuget#1 · May be fixed by #61
Assignees
Labels
enhancement New feature or request

Comments

@houseofcat
Copy link

houseofcat commented Jul 31, 2020

First of thanks for creating this action, I am using the pants off of it right now.

This seems like a straightforward request that I am surprised it hasn't been solved (that I could find with Googling a way to do this).

Would rather create a step that I supply a directory and we just recursively find all .CSPROJ and pack/push them with the same configuration and continue-on-error true.

Providing my current workflow as there maybe a way to do this that I just can't seem to find the instructions for.

https://github.com/houseofcat/Library/blob/master/.github/workflows/nuget-publish.yml

@houseofcat houseofcat added the enhancement New feature or request label Jul 31, 2020
@AraHaan
Copy link
Contributor

AraHaan commented May 19, 2021

I would rather do this instead:

    - name: Publish Release      
      id: publish_nuget
      uses: brandedoutcast/publish-nuget@master
      continue-on-error: true
      with:
        # Filepath of the project to be packaged, relative to root of repository
        PROJECT_FILE_PATH: **/*.csproj
        # Flag to toggle git tagging, enabled by default
        TAG_COMMIT: false
        # API key to authenticate with NuGet server
        NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
        INCLUDE_SYMBOLS: false

AraHaan added a commit to AraHaan/publish-nuget that referenced this issue May 19, 2021
Fixes brandedoutcast#41.

This adds 2 dependencies to publish-nuget that then allows file globbing support for ``PROJECT_FILE_PATH`` and then allows pushing them.
@AraHaan
Copy link
Contributor

AraHaan commented May 20, 2021

Merged into my fork test it out with Elskom/publish-nuget@main

@AraHaan
Copy link
Contributor

AraHaan commented Jun 16, 2021

Got this working by doing amends and force pushes all day and running CI over and over again until it started working like I wanted:

Run Elskom/publish-nuget@main
executing: [dotnet nuget list source]
Registered Sources:
  1.  xunit-prereleases [Enabled]
      https://www.myget.org/F/xunit/api/v3/index.json
  2.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json

executing: [dotnet nuget enable source nuget.org]
Package source with Name: nuget.org enabled successfully.

Project Filepath: src/Elskom.GitInformation/Elskom.GitInformation.csproj
Version Filepath: src/Elskom.GitInformation/Elskom.GitInformation.csproj
Version Regex: /^\s*<Version>(.*)<\/Version>\s*$/m
Version: 1.0.0
Package Name: Elskom.GitInformation
Project Filepath: src/GitBuildInfo.SourceGenerator/GitBuildInfo.SourceGenerator.csproj
Version Filepath: src/GitBuildInfo.SourceGenerator/GitBuildInfo.SourceGenerator.csproj
Version Regex: /^\s*<Version>(.*)<\/Version>\s*$/m
Version: 1.0.10
Package Name: GitBuildInfo.SourceGenerator
Status code: 404: Not Found
No packages found. Pushing initial version...
✨ found new version (1.0.0) of Elskom.GitInformation
NuGet Source: https://api.nuget.org
executing: [dotnet nuget push artifacts/Elskom.GitInformation.1.0.0.nupkg -s nuget.org -k *** --skip-duplicate]
Pushing Elskom.GitInformation.1.0.0.nupkg to 'https://www.nuget.org/api/v2/package'...
  PUT https://www.nuget.org/api/v2/package/
  Created https://www.nuget.org/api/v2/package/ 852ms
Your package was pushed.

Status code: 200: OK
This version is new, pushing...
✨ found new version (1.0.10) of GitBuildInfo.SourceGenerator
NuGet Source: https://api.nuget.org
executing: [dotnet nuget push artifacts/GitBuildInfo.SourceGenerator.1.0.10.nupkg -s nuget.org -k *** --skip-duplicate]
Pushing GitBuildInfo.SourceGenerator.1.0.10.nupkg to 'https://www.nuget.org/api/v2/package'...
  PUT https://www.nuget.org/api/v2/package/
  Created https://www.nuget.org/api/v2/package/ 1194ms
Your package was pushed.

However my fork is a breaking change from this version, for starters I was forced to strip automatic build and pack into it's own action which can actually do a lot more than just build and pack like run unit tests. If interested I gutted that logic out into https://github.com/Elskom/build-dotnet/

Also the old INCLUDE_SYMBOLS input and other bits was removed for the msbuild project properties that the .NET Core CLI program (including the dotnet nuget pack) respects being set and would push the symbol package when those are set. As such I thought it's worth removing it from the action due to that feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
3 participants