Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet template #15

Closed
wants to merge 110 commits into from

Conversation

RobotOptimist
Copy link
Contributor

#14

A dotnet new template in a template folder. Also included is a nuspec file.
I was able to test the installation of the template successfully.
I was unable to test the use of the template because the nuget package has not been published yet
I assumed the version would be 0.1.31-alpha, but this will need updated.

I can make this work using your feedzio by adding a nuget.config and changing the version to match that prerelease - let me know if you need those changes.

@davidfowl
Copy link
Collaborator

I can make this work using your feedzio by adding a nuget.config and changing the version to match that prerelease - let me know if you need those changes.

Yes this would be great. Can we also integrate it into the github actions script.

@davidfowl
Copy link
Collaborator

I assumed the version would be 0.1.31-alpha, but this will need updated.

Yes, I also broke a bunch of APIs

@RobotOptimist
Copy link
Contributor Author

I've added the nuget config and changed the version to match what's in feedz.io but I haven't figured out how to make these things update automatically in the ci.yml yet. Looks like I can update these files using powershell and check them in using actions - but I don't know how to discover the new version number while the actions are running.
I looked at the Carter repo to see if I can get some insight, but it doesn't appear they're doing that with github actions. I'm continuing to investigate the problem to figure it out - but I'm held up for now

@davidfowl
Copy link
Collaborator

There’s also code changes that need to be made

@RobotOptimist
Copy link
Contributor Author

yikes! So that's what you meant by API changes, I've pulled that in - still reading up on the automatic version incrementing -trying to see if Nerdbank has documentation that can help for this template

@RobotOptimist
Copy link
Contributor Author

@davidfowl I want to give you an update on this since it's taking so long. I've managed to accomplish the task mostly, there is an issue using the NerdBank msbuild variable to set the version in the csproj files. I followed what documentation there was on that, but ultimately resorted back to powershell - so there are a couple lines of powershell still. I apologize - but looking at other github workflow files from other projects, I'm not convinced it can be avoided.
So, that's all working great and I can upload the template project to feedz.io and that works fine.

While testing the template project to make sure it could be used as expected I ran against this bug:
dotnet/templating#1423
So now I'm trying to find a way to override the version but only for the Feather Template project so that it can be consumed by users. I haven't opened an issue with NerdBank yet, but I've begun to engage them in their gitter: https://gitter.im/AArnott/Nerdbank.GitVersioning

You'll note that we're not the only ones having issues with NerdBank in github actions. I think as a side effect of this effort I'll do a PR to improve their documentation on this. Just little gotchas, but they have a great tool and I understand it much better than I did before.

Anyway, I'm deeply grateful for the opportunity to contribute anything meaningful to this project and I apologize for the delay in accomplishing this task.

@davidfowl
Copy link
Collaborator

I see, I guess we can live with it for now then.

@RobotOptimist
Copy link
Contributor Author

RobotOptimist commented Jan 17, 2020

@davidfowl okay - I've got this working

  1. I've rewritten the process for creating the template to do it the way you suggested.
  2. I've refactored my csproj names and directories to be consistent with project naming conventions
  3. I've added a version.json and modified the ci.yml to use the latest and greatest from actions/checkout and to perform stable releases of the template project so it can be used
    a. you'll notice this does a checkout of a branch (in this case master) and fetches commit history - this is necessary to use the nbgv features the way they were intended to be used
  4. If this is not pushed to nuget.org then users will need to add the feedz.io source in order to use this with dotnet new -i FeatherHttp.Templates afterwards they'll be able to create the hello world project by typing dotnet new featherhttp

I've learned a ton about github actions, nbgv, and template projects as a result of this - it's been a pretty great experience

@RobotOptimist
Copy link
Contributor Author

Hey @davidfowl now that I've got a better understanding of what's needed, this branch is a bit of a mess - what do you think of me closing the PR and setting up a fresh branch with a cleaner commit history that arrives at the goal a bit more directly?

@davidfowl
Copy link
Collaborator

Sounds good to me. Do you want me to close it? You can as well

@RobotOptimist
Copy link
Contributor Author

I'll take care of it, thanks David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants