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

GitHub CI Integration: Push on release branch doesn't upload draft changelog #53

Open
3Mydlo3 opened this issue Mar 19, 2023 · 2 comments

Comments

@3Mydlo3
Copy link

3Mydlo3 commented Mar 19, 2023

According to user guide, pushing on a release branch (main/master by default) should upload a draft release, but it doesn't.

Depending on the kind of GitHub event, the run command will automatically:

  • If it is a pull-request or a push to a non release branch, it will perform a full build.
  • If it is a push to a branch and the branch is a release branch (configured in github.branches), then it will perform a full build and it will upload a release draft with changelog with the name of the branch prefixed by draft-{name_of_the_branch} (example: draft-main). You can disable the create of a draft release but it is usually convenient to look at what will be your next release notes.
  • If it is a push with a tag version (e.g v1.9.6 as configured with [github] section in the configuration) it will perform a full build with publish
    • For an application, it will publish multiple cross-compiled packages to your release

Workflow and dotnet-releaser.toml. Below is a log from Github Actions at the exact commit:

── Configuring ─────────────────────────────────────────────────────────────────
2023/03/19 09:20:00.745 info: [2] Running from GitHub: user = ArmaForces, repo = ArmaServerManager, event = push, ref_name = master, ref_type = branch
2023/03/19 09:20:00.750 info: [3] Loading configuration from /home/runner/work/ArmaServerManager/ArmaServerManager/dotnet-releaser.toml
2023/03/19 09:20:00.872 info: [5] Loading 1 projects
2023/03/19 09:20:08.137 info: [6] Packages and Projects
┌──────────────────────────────┬──────┬─────────┬────────────────────┬──────────────────┬───────────┬───────┐
│ Project │ Kind │ Version │ TargetFramework(s) │ License │ Packable? │ Test? │
├──────────────────────────────┼──────┼─────────┼────────────────────┼──────────────────┼───────────┼───────┤
│ … │ │ │ │ │ │ │
│ ArmaForces.ArmaServerManager │ exe │ 0.1 │ net6.0 │ No license found │ │ │
└──────────────────────────────┴──────┴─────────┴────────────────────┴──────────────────┴───────────┴───────┘
2023/03/19 09:20:08.192 info: [7] Connecting to GitHub
2023/03/19 09:20:08.951 info: [8] The trigger event is push and the branch master. Build only mode selected.

I see that a BuildInformation.AllowPublishDraft is set to true twice (for Publish and for Run or Build if not disabled), but the property is never accessed.

@FrediKats
Copy link
Contributor

Bump.

As I understand, the problem is not in BuildInformation.AllowPublishDraft or smth like this. This is architecture restriction. Current implementation expect NuGet pacakge for creating change log. I see in code this call tree:

->GitHubDevHosting.CreateOrUpdateReleaseImpl(String, String, ReleaseVersion, ChangelogResult?) : Task<Release>
-->GitHubDevHosting.UpdateChangelogAndUploadPackages(String, String, ReleaseVersion, ChangelogResult?, List<AppPackageInfo>, Boolean, Boolean) : Task
--->ReleaserApp.PublishPackagesAndChangelog(String?, BuildInformation, GitHubDevHostingConfiguration, IDevHosting?, IDevHosting?, ChangelogResult?, Boolean) : Task
---->ReleaserApp.RunImpl(String, BuildKind, String, String?, String?, String?, Boolean, Boolean, String?) : Task<Boolean>

So, if you don't have NuGet packags in repo that change CreateOrUpdateReleaseImpl method will be skipped. I faced with same problem while using dotnet-releaser with console tool and ASP project.

@xoofx, what you think about supporting change log publishing for scenario without NuGet?

@xoofx
Copy link
Owner

xoofx commented May 20, 2024

I don't remember exactly why I had to do both the package upload and changelog together, but I remember having problems posting a draft release back in the days and it was conflicting with packages uploads, or it was a problem with publishing the release later. I couldn't make it work but forgot exactly why... 🤔

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

No branches or pull requests

3 participants