👷 Add create release workflow#6565
Conversation
|
Co-authored-by: dubzzz <[email protected]>
| * Scans the CHANGELOG.md file line by line until finding the start of another release note. | ||
| * @returns {{version: string, changelog: string}} | ||
| */ | ||
| function extractLatestChangelog() { |
There was a problem hiding this comment.
@copilot add a parameter to this function to specify the sub-directory where to take the changelog from. It could be fast-check, but also ava or any of the others.
There was a problem hiding this comment.
Added a packageDir parameter to extractLatestChangelog() — it now takes the sub-directory name (e.g. 'fast-check', 'ava', 'jest') and reads packages/<packageDir>/CHANGELOG.md. Commit: 6d902a3.
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened] |
There was a problem hiding this comment.
@copilot it should be reexecuted whenever the pr gets updated. Use the same trigger as other actions based on pr trigger
There was a problem hiding this comment.
Updated the trigger to types: [opened, edited, reopened, synchronize] matching the pattern used by validate-pr-title.yml. Commit: 6d902a3.
@fast-check/ava
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
|
👋 A preview of the new documentation is available at: http://6987a8f0797eb129f1e796da--dubzzz-fast-check.netlify.app |
Co-authored-by: dubzzz <[email protected]>
This comment has been minimized.
This comment has been minimized.
1 similar comment
| * @returns {{version: string, changelog: string}} | ||
| */ | ||
| function extractLatestChangelog(packageDir) { | ||
| const changelogPath = path.join(process.env.GITHUB_WORKSPACE || process.cwd(), 'packages', packageDir, 'CHANGELOG.md'); |
There was a problem hiding this comment.
Switched to __dirname for path resolution: path.join(__dirname, '..', '..', '..', 'packages', packageDir, 'CHANGELOG.md'). Commit: 2078bc5.
| changelogLines.pop(); | ||
| } | ||
|
|
||
| return { version, changelog: changelogLines.join('\n') }; |
There was a problem hiding this comment.
@copilot Extract the name of the release or tag line too
There was a problem hiding this comment.
Now extracting the release name (italic tag line like _Proper attestation file naming_) into a releaseName field. The return type is now {version, releaseName, changelog}. Commit: 2078bc5.
Co-authored-by: dubzzz <[email protected]>
|
👋 A preview of the new documentation is available at: http://6987ab43a47c6419d0a75529--dubzzz-fast-check.netlify.app |
| changelogLines.pop(); | ||
| } | ||
|
|
||
| return { version, releaseName, changelog: changelogLines.join('\n') }; |
There was a problem hiding this comment.
@copilot also return the tag name of such version, check how we named version in the past. fast-check does it differently from others but others use the same pattern
There was a problem hiding this comment.
Added a computeTagName helper and a tag field to the return value. fast-check uses v<version>, others use <packageDir>/v<version> — matching the convention in generate-changelog.cjs. Commit: e2c8985.
| } | ||
| if (foundFirst) { | ||
| const releaseNameMatch = line.match(/^_(.+)_$/); | ||
| if (releaseNameMatch && !releaseName) { |
There was a problem hiding this comment.
@copilot only use if(abc) or if(!abc) if abc is a boolean value, otherwise clearly specify the value you check for (null? undefined? 0? Empty string?)
Applies the guideline for the whole file
There was a problem hiding this comment.
Updated all checks to use explicit comparisons: foundFirst === true, releaseNameMatch !== null, releaseName === ''. Commit: e2c8985.
Co-authored-by: dubzzz <[email protected]>
|
@copilot change the trigger of the workflow..it should not be on pull request but manually triggered with something like: on: Instead of printing a comment, create a new release using the action we already use in another action. Make suer to mark fast-check releases as latest while for the others dont toggle on latest. Make sure you configure the action to create the tag as it will be missing when the action will run and this is the role of this action to create it |
Co-authored-by: dubzzz <[email protected]>
| if (releaseNameMatch !== null && releaseName === '') { | ||
| releaseName = releaseNameMatch[1]; | ||
| } | ||
| changelogLines.push(line); |
There was a problem hiding this comment.
@copilot put it in a else so that we don't put the release name in the changelog
There was a problem hiding this comment.
Moved changelogLines.push(line) into an else branch so the release name line is excluded from the changelog body. Commit: 4267afc.
Co-authored-by: dubzzz <[email protected]>
| core.setOutput('tag', tag); | ||
| core.setOutput('release_name', releaseName); | ||
| core.setOutput('changelog', changelog); | ||
| - name: Create GitHub Release |
There was a problem hiding this comment.
@copilot add a dry run boolean value that could be checked to avoid running the creation of the release
There was a problem hiding this comment.
Added a dry_run boolean input (default: false). When set to true, the release creation step is skipped via an if condition, while the changelog extraction still runs so you can verify the outputs. Commit: 224151d.
There was a problem hiding this comment.
@copilot in dry run print the values you extracted via the script in the condole (maybe always print them)
There was a problem hiding this comment.
Added console.log calls that always print the extracted version, tag, release name, and changelog — visible in both normal and dry run mode. Commit: fad6e32.
Co-authored-by: dubzzz <[email protected]>
|
👋 A preview of the new documentation is available at: http://6989088a206eed3933d3149c--dubzzz-fast-check.netlify.app |
Co-authored-by: dubzzz <[email protected]>
|
👋 A preview of the new documentation is available at: http://69890baf5c1282533ab8ac1d--dubzzz-fast-check.netlify.app |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6565 +/- ##
==========================================
- Coverage 94.85% 94.84% -0.02%
==========================================
Files 207 207
Lines 5581 5585 +4
Branches 1468 1470 +2
==========================================
+ Hits 5294 5297 +3
- Misses 274 275 +1
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
.github/workflows/scripts/extract-changelog.cjs.github/workflows/create-release.ymlpackageDirparameter toextractLatestChangelog()to support any package sub-directory__dirnamefor path resolutionv<version>for fast-check,<packageDir>/v<version>for others)workflow_dispatchtrigger with package choice inputsoftprops/action-gh-releaseinstead of posting PR commentslatest, others as not latestpr-changelog.ymltocreate-release.ymlnamefielddry_runboolean input to skip release creationOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.