Coder Social home page Coder Social logo

Publish to NuGet about audibleapi HOT 17 CLOSED

rmcrackan avatar rmcrackan commented on July 16, 2024
Publish to NuGet

from audibleapi.

Comments (17)

rmcrackan avatar rmcrackan commented on July 16, 2024 1

https://github.com/rmcrackan/AudibleApi#getting-started

It's not much, but's it's a start. I can add more when I see what real-world questions come up.

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Good idea. This should definitely happen eventually. It's just that there are so many things above it in my priority list. I've never set anything up before to deploy/publish to nuget. If you have some resources which would make it easier, then I'm more likely to push it ahead in the queue. It would be great to be able to offer this as a nuget pkg

I started to type out a reply here about how all to use it. This is something I really need to provide more publicly (which is to say: I really ought to have done this by now) though so I'll create a 'getting started' section on the main page instead. Expect this later this evening.

from audibleapi.

djdembeck avatar djdembeck commented on July 16, 2024

Thanks so much for writing that up!

I'm still green on C#, but this seems like an easy task to accomplish. The difficulty comes in with Dinah.Core. This is likely another package you will want to publish, then include as a dependency here. I could quite easily publish the former, but AudibleApi will need some changes, on which I am not sure how you want to approach - in order to streamline the dependency.

As it stands, there's also no mention of Dinah.Core in the readme, but I believe it needs to be cloned by any user, alongside of this repo (hence the ../..).

Again, since I am not sure the restructuring you would like to do, I haven't submitted a PR with these Github Actions, but they are both the same (just changing the name). All you need is a Secret setup as NUGET_API_KEY with your Nuget account API key.

Dinah.Core Action example: https://github.com/djdembeck/Dinah.Core/blob/master/.github/workflows/main.yml

AudibleApi Action example:
https://github.com/djdembeck/AudibleApi/blob/master/.github/workflows/main.yml

Dina.Core on Nuget example (I will delete it if/when you get it setup under your account):
https://www.nuget.org/packages/Dinah.Core/

Github Action template used:
https://github.com/marketplace/actions/publish-nuget

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Please see if you can remove your Dinah.Core from nuget. I really hope it allows me to reuse the name.

In the devops world, I am firmly dev with pretty much no ops so this is all greek to me. Here's my script so far. What am I missing?

sign up with a microsoft account. necessary for nuget
login to nuget.org
nuget.org > username (in upper right) > API Keys
create
copy

in my code space:
manually create yaml in repo
.github\workflows\publish.yml
example yaml template for publishing to nuget: https://github.com/marketplace/actions/publish-nuget
push to github

github.com > settings > secrets
click 'New repository secret'
name must match ${{secrets.NUGET_API_KEY}} in .yml file
Name: NUGET_API_KEY
Value: paste api key from above
click 'Add secret'

from audibleapi.

djdembeck avatar djdembeck commented on July 16, 2024

Yes, you have the steps down perfectly! And then uncomment:

  • PROJECT_FILE_PATH and change the path.
  • PACKAGE_NAME and change the name
  • VERSION_STATIC and change the version (I think Nuget starts at 1.0.0 no matter what you set).
  • NUGET_KEY

I added you as an owner of the nugget repo, so you can take ownership and remove me!

If you need anything else from me I'm happy to help. Can't wait to start using your project!

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Thanks so much!

I'd like to do the same for other projects. How do I initially create a package? When I go to [username] > Manage Packages > Add new, it wants me to upload. I have nothing to upload yet.

from audibleapi.

djdembeck avatar djdembeck commented on July 16, 2024

Awesome!

You don't need to interact with the NuGet website at all for that! Just setup a copy of the .github/workflows/publish.yaml in this project, following the same steps as you did above. Then when the Action builds successfully, it creates the package over on NuGet for you! Pretty neat right?!
I was pleasantly surprised how streamlined a process it is. If you've already created a page on NuGet, it should still publish there for you.

Glad you're getting this all going, thanks so much!

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Thanks again for all your help. My solutions have projects which I'm going to deploy as separate nuget pkg.s. Is there a generally considered best practice for putting these in the same yaml file? Or should each get its own file?

from audibleapi.

djdembeck avatar djdembeck commented on July 16, 2024

To make sure I'm following, you mean you would like to publish certain directories within a repo as separate nuget packages, right? For example, AudibleApiDTOs as a separate pkg?

Then, yes, these are best kept as their own yaml files. Reason being you can make changes to one project, and say it can't build successfully - in that case none of the other packages would build.

When you separate each pkg into it's own yaml, they can build independently of issues on other packages. You would also probably change the yaml name to reflect this, so publish.yaml -> pubilsh-audibleapi.yaml, etc.

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Yes -- exactly (after I rename it something better). By EOD today or tomorrow I hope to have the core pieces nuget-ized

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Aggg ... so close! I can't find a way to do this for net5.0-windows

Package Name: Dinah.Core.WindowsDesktop
executing: [dotnet build -c Release Dinah.Core.WindowsDesktop/Dinah.Core.WindowsDesktop.csproj]
/usr/share/dotnet/sdk/5.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/runner/work/Dinah.Core/Dinah.Core/Dinah.Core.WindowsDesktop/Dinah.Core.WindowsDesktop.csproj]

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

I assume it's preferable to have a separate nuget api key per github repo?

from audibleapi.

djdembeck avatar djdembeck commented on July 16, 2024

Aggg ... so close! I can't find a way to do this for net5.0-windows

Package Name: Dinah.Core.WindowsDesktop
executing: [dotnet build -c Release Dinah.Core.WindowsDesktop/Dinah.Core.WindowsDesktop.csproj]
/usr/share/dotnet/sdk/5.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/runner/work/Dinah.Core/Dinah.Core/Dinah.Core.WindowsDesktop/Dinah.Core.WindowsDesktop.csproj]

Hmm, this looks to not be supported in net5: dotnet/sdk#3592 (comment)
Out of my element on that one.

I assume it's preferable to have a separate nuget api key per github repo?

Yes. It's pretty simple to do, and at least you don't need one per yaml file, just per repo :)

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

Well, I'm down to just that one which shouldn't block you. All repos are cleaner and stuff is in nuget pkg.s where applicable.

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

I'm too tired and demoralized to fix this right now, but it's also not going to work without Cryptography.js and locales.json . In the short term you might consider just copying these files from the audibleapi repo

from audibleapi.

rmcrackan avatar rmcrackan commented on July 16, 2024

All parts are now successfully building. AudibleApi nuget is available and the code base is cleaned up. I have NOT tested it much. That will come later. For now my actually job would probably like to see me do a bit more work.

Let me know if you have any questions.

from audibleapi.

djdembeck avatar djdembeck commented on July 16, 2024

Excellent work! Thanks so much for sticking with learning something new for the good of the project :) Now it's my turn to start coding with this imported!

Tell your job I was researching better packaging and dependency options for the good of the company hehe

from audibleapi.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.