Conversation
|
I understand your previous question now. Can we make https://github.com/vikejs/vike/tags and the CHANGELOG.md be the source of truth here? |
|
(FYI we use https://github.com/brillout/release-me throughout many projects — not using it would be a little too disruptive.) |
The goal is to create GitHub releases in https://github.com/vikejs/vike/releases On the creation of a GitHub release, I think you want to get the changelog by the version in CHANGELOG.md and not by commits, right?
Should this feature be done here? |
Yes I know.
Yes, the source of truth should ideally be CHANGELOG.md and not the commits (to keep things DRY).
Let's first do it here and then we can see whether we want to move it to |
Done |
|
How about we run this workflow when the CHANGELOG.md file changes? One issue is that I have to regularly modify |
|
Sure, I can do. Should I leave also the manual trigger ( |
To be clear: what I mean is that whenever
Ok why not. |
Done (it needs to be tested) |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…add_publish_workflow
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This reverts commit db1ae8f.
|
I think it can work indeed. It seems to be working: https://github.com/vikejs/vike/releases — although it didn't sync all other releases. It should fully sync all releases with Can you PM me on discord or via email? I'll send you an API key with enough permissions for you to run the script locally. |
Top
There aren't other release. Logic:
Eg: when v0.4.256 will be released (CHANGELOG.md updated), the workflow:
IMO it's not necessary, what should I test? |
I see, makes sense from a release subscription POV. But I think we can (and should?) retroactively publish all previous releases? Also nice to test the script. |
Agree, IMO we should create a new workflow (create all previous release using pagination |
|
How about keeping it the same workflow but before proceeding with normal work we prepare for new repos: "if number of releases === 0" => publish all releases. That way we can just copy & paste the workflow for other projects and it just works. |
|
I just removed 0.4.255. |
Agree, in the current - if (releaseToCreate) {
- // https://docs.github.com/en/rest/releases/releases#create-a-release
- await githubRequest(`/repos/${owner}/${repo}/releases`, {
- token,
- method: 'POST',
- body: releaseToCreate,
- })
- console.log(`Created release ${versionTag}`)
- }
-
- for (const release of releasesToUpdate) {
- // https://docs.github.com/en/rest/releases/releases#update-a-release
- await githubRequest(`/repos/${owner}/${repo}/releases/${release.release_id}`, {
- token,
- method: 'PATCH',
- body: { body: release.body },
- })
- console.log(`Updated release ${release.tag_name}`)
- }
+ // Create release from oldest to newest, so that the release list
+ // is sorted by creation date in the same order as the changelog sections
+ const allTagReleasesToCreate = Object.keys(sections).reverse()
+ for (const tagName of allTagReleasesToCreate) {
+ await githubRequest(`/repos/${owner}/${repo}/releases`, {
+ token,
+ method: 'POST',
+ body: {
+ name: tagName,
+ tag_name: tagName,
+ target_commitish: defaultBranch,
+ body: sections[tagName]
+ }
+ })
+ console.log(`Created release ${tagName}`)
+ }WDYT, can I do the commit? |
|
I'd rather write the logic once now and be done with it. Zero manual procedure:
That's going to neat, e.g. for vike-react |
|
Done |
|
There seem to be some parsing issue: https://github.com/vikejs/vike/releases/tag/v0.1.1 |
|
There are some error in CHANGELOG.md: versions <= 0.1.0 use IMO you have to:
|
|
Do you want a PR to fix CHANGELOG.md? |
|
The best would be somewhat lenient:
I.e.:
Also an ability to dry-run the script would be awesome. Let's us test the script without doing API requests. |
|
Done |
|
|
@rtritto Any luck? Polishing this PR makes a huge difference — if we can merge it once and then forget about it that'd be the best. |
|
This is LGTM, you can go ahead as you like |
|
I'd rather merge after this: Contribution welcome. We have a lot of higher priorities — we unfortunately cannot afford working on low-priority things. |
Fix #3154