-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
[WIP] New build tool #299
[WIP] New build tool #299
Conversation
Dummy change to open PR
…efaultinterface branch
on: | ||
push: | ||
branches: | ||
- defaultinterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change to main
but I wanted to build on top of your defaultinterface
branch where you had already moved Newtonsoft into its own project.
on: | ||
push: | ||
tags-ignore: | ||
- 'newtonsoft-*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sure that it doesn't run for when we want to release a new version of the Newtonsoft package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that looking for a tag containing the term "newtonsoft"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, that should have read "for when we want to push a release of the Carter package".
And you're correct, this is ignoring tags that start with newtonsoft-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thing is tags will probably just be v7.0.0
for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used different tags as I thought you wanted to be able to have different versions of the Carter
and the Carter.ResponseNegotiators.Newtonsoft
packages while the source stays in the same repo.
"Regular" tags, like v7.0.0
, would release Carter
, while newtonsoft-v7.0.0
would release the Carter.ResponseNegotiators.Newtonsoft
package.
Did I make a wrong assumption thinking you might want to keep their versioning separate?
My thinking was that if we keep them in sync, new versions of Carter.ResponseNegotiators.Newtonsoft
could be released without any changes in them.
on: | ||
push: | ||
tags: | ||
- 'newtonsoft-*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sure that it runs only for when we want to release the Newtonsoft package.
push.sh
Outdated
TARGET_PACKAGE=$1 | ||
if [ "$TARGET_PACKAGE" = "carter" ]; then | ||
TARGET_PACKAGE_PATH="./src/Carter/**/*.nupkg" | ||
elif [ "$TARGET_PACKAGE" = "newtonsoft" ]; then | ||
TARGET_PACKAGE_PATH="./src/Carter.ResponseNegotiators.Newtonsoft/**/*.nupkg" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a Bash expert by any means.
This is the way I found to target either the main Carter
or the Newtonsoft package,
@jchannon would you mind taking a look and letting me know if that sort of fits what you had in mind? Very keen for feedback and happy to make changes to adjust things. Cheers. |
Looks good, the only thing I wouldnt want is a push to nuget on a PR merge. For pre-releases I'd probably tag the repo as |
on: | ||
push: | ||
tags-ignore: | ||
- 'newtonsoft-*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that looking for a tag containing the term "newtonsoft"
- name: Build Reason | ||
run: echo ${{github.ref}} and ${{github.event_name}} | ||
- name: Build with dotnet | ||
run: find . -path ./template -prune -false -o -name '*.csproj' -execdir dotnet build --configuration Release --nologo {} \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have to change this or move the newtonsoft stuff out of the main repo otherwise this will find the csproj.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it depends on how split out you want them to be. Right now it'll find all csprojs and build them; if that's an issue, we could look at using path filters in the GitHub Actions workflow to only build projects we're interested in.
I find it overkill, that project doesn't add much overhead now, but it's up to you.
OK, got it, I'll push an update for this. |
No you were right, I just couldn't envisage how we'd do two separate tag
approaches :)
I am wondering if I move it out into it's own repo whether that might be
clearer however I'd still somehow want to bump those external packages to
use the latest carter when we release a new carter version
…On Mon, 26 Sept 2022 at 12:59, Mickaël Derriey ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In .github/workflows/publish-release.yml
<#299 (comment)>
:
> @@ -0,0 +1,29 @@
+name: Main tag created workflow
+
+on:
+ push:
+ tags-ignore:
+ - 'newtonsoft-*'
I used different tags as I thought you wanted to be able to have different
versions of the Carter and the Carter.ResponseNegotiators.Newtonsoft
packages while the source stays in the same repo.
"Regular" tags, like v7.0.0, would release Carter, while newtonsoft-v7.0.0,
would release the Carter.ResponseNegotiators.Newtonsoft package.
Did I make a wrong assumption thinking you might want to keep their
versioning separate?
My thinking was that if we keep them in sync, new versions of
Carter.ResponseNegotiators.Newtonsoft could be released without any
changes in them.
—
Reply to this email directly, view it on GitHub
<#299 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZVJTADOJPVEIW4KOUKCDWAGFZNANCNFSM6AAAAAAQUBPU6Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Cool 👍
I think there are several options here:
Whether to move it in its own repository is up to you, I'd say. For the template project, one thing I did in the past that worked fairly well was the following:
This way, you always keep an updated template project with the latest |
I mean we already have a couple of external repos that depend on carter as a package reference but have not been kept up to date really because of the complexities here and me being bothered to work out to do it best :) So if we did move the newtonsoft package out then we'd have 3 or 4 repos that need the package refence updated. Whilst you say we could query nuget, how would you do that, a timer or I wonder if there is a cross repo trigger eg/Carter gets tagged and can then somehow notify other repos. Regarding the template I also came up with that idea but never got around to doing it, if we did swap the references I'd also want to do that automatically as I already manually change it once Carter is released and I don't like that :) |
I'm not aware of cross-repo way of triggering workflows. My initial idea was manually triggering the workflow run (I didn't know there were other repos with package references to Carter), but scheduled runs could also work.
I wasn't clear enough, apologies. Yes, the swapping was done automatically when I implemented that at work a while ago. |
A manually triggered workflow that did a find and replace, commit and asked for a tag and then pushed and released to nuget could be very handy indeed! |
OK, we can have a look at that in the future. How would you like to go forward with this PR? Do you want to wait for .NET 7 to be out and your changes to be merged to |
Remove the publishing of a prerelease package when a PR is merged to `main` as per #299 (comment).
@jchannon friendly bump about #299 (comment) |
👍 will take a look next week. At NDC at the mo 😁
…On Fri, 30 Sep 2022 at 10:54, Mickaël Derriey ***@***.***> wrote:
@jchannon <https://github.com/jchannon> friendly bump about #299 (comment)
<#299 (comment)>
—
Reply to this email directly, view it on GitHub
<#299 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZVJWPMCONT7MOVFR3XITWA2TEXANCNFSM6AAAAAAQUBPU6Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
As your PR is going to be merged into my branch which has all the .NET 7 changes on it I wonder if we can get it all working in your branch? I just approved a thing in GH Actions so any changes made in the workflow files should build here 🤞 |
I've made a few changes to test out the real thing, but I believe it will need to be tested on your repo as I'm fairly certain I won't have access to your repo's secrets, like the feedz.io API key. |
It now says that the workflow is awaiting approval, so I suppose you need to do something on your end. To test the whole thing, you'll need to add:
The scenarios to test those would be:
It's a bit awkward testing this as it will push packages to NuGet; can you unlist them afterwards? Or maybe you could create tags with versions lower than the current one so that consumers don't get asked to update? You also mentioned earlier that you would create tags with a leading |
Ok, approved the workflow. Tags don't seem to contain the prefix on the repo, I just checked. |
Sweet, thanks. The run failed, supposedly because the workflow didn't have access to the Maybe you need to enable forks having access to the secrets? It's a bit sketchy, unless you can do this on a case-by-case basis. Otherwise, we could look at making me a temporary contributor to this repo and I open a PR from a separate branch in this repo?
OK, so you want to keep it this way, with no prefix? |
Just given you write access! 😄 Yeah no prefix required |
Sweet, thanks, opened #300 and closing this PR. |
Fixes #298
This is my first attempt at trying to come up with something that fits the bill.
Mostly to get something in front of you and get feedback.
For now, I've created different workflows to make it easier for me to test things; in the future, we could look at consolidating them and including some logic within the workflow itself.
They're mostly the same, the things that change are:
Carter
package, or the Newtonsoft one)push.sh
scriptHere's the list of actions I took on the repo, and what would happen:
6.1.3
tagnewtonsoft-6.0.0
tag