-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
feat: add beta release workflow #1148
Conversation
Beta version released with the last commit 🚀
or
|
Beta version released with the last commit 🚀
or
|
The gh-actions commit (9319c87 for instance) seems to be "hiding" the last checks that were run. Expected to see the checks, like this. |
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.
Approving to see if checks are re-run. If not, changes should be made,
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.
Nope 🤔
that's weird, I didn't realize it before, thanks for letting me know, do you have any idea on how to fix it? |
Beta version released with the last commit 🚀
or
|
Beta version released with the last commit 🚀
or
|
Beta version released with the last commit 🚀
or
|
eb3d694
to
ab3836b
Compare
Beta version released with the last commit 🚀
or
|
This pull request is stale because it has not seen activity in 30 days. Remove the |
477f2d1
to
b47e870
Compare
WalkthroughThe recent updates focus on enhancing GitHub workflows and scripts for better automation and maintenance of a software project. Key changes include the introduction of a new workflow for beta releases, updates to node versions and actions in existing workflows, and adjustments in scripts for beta version management. These modifications streamline development processes and improve the deployment pipeline. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Beta version released with the last commit 🚀
or
|
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.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/*.lock
Files selected for processing (7)
- .github/workflows/beta-release.yaml (1 hunks)
- .github/workflows/bundlesize.yaml (3 hunks)
- .github/workflows/lint.yaml (3 hunks)
- .github/workflows/pull-request.yaml (1 hunks)
- .github/workflows/stale.yml (1 hunks)
- beta-release.js (1 hunks)
- package.json (1 hunks)
Files skipped from review due to trivial changes (6)
- .github/workflows/beta-release.yaml
- .github/workflows/bundlesize.yaml
- .github/workflows/lint.yaml
- .github/workflows/pull-request.yaml
- .github/workflows/stale.yml
- package.json
Additional comments not posted (1)
beta-release.js (1)
12-18
: The implementation ofrunCommand
function looks good and properly handles command execution and output.
const AutoBetaRelease = async () => { | ||
// get all the versions of the package from npm | ||
const { stdout } = await runCommand(`npm view . versions --json`) | ||
|
||
// show npm published versions of this package | ||
console.log(stdout) | ||
|
||
// check if there is a beta release with the same issue number on published versions | ||
const arrayOfBetaReleases = JSON.parse(stdout).filter((version) => | ||
version.includes(`${package.version}-beta.${issueNumber}`), | ||
) | ||
|
||
let fullLastBetaRelease = null | ||
|
||
// if yes, get the latest beta release. Output: 1.0.0-beta.1.rc.0 | ||
if (arrayOfBetaReleases.length) { | ||
fullLastBetaRelease = arrayOfBetaReleases[arrayOfBetaReleases.length - 1] | ||
} | ||
|
||
console.log('Last Beta Release: ', fullLastBetaRelease) | ||
|
||
let nextBetaReleaseVersion = 0 | ||
|
||
if (fullLastBetaRelease) { | ||
const lastBetaReleaseRCVersionArray = fullLastBetaRelease.match(/rc.+[0-9]+/g) | ||
|
||
const lastBetaReleaseRCVersion = | ||
lastBetaReleaseRCVersionArray && lastBetaReleaseRCVersionArray.length | ||
? lastBetaReleaseRCVersionArray[0] | ||
: null | ||
|
||
const lastBetaReleaseVersion = lastBetaReleaseRCVersion | ||
? lastBetaReleaseRCVersion.split('.')[1] | ||
: 0 | ||
|
||
nextBetaReleaseVersion = parseInt(lastBetaReleaseVersion, 10) + 1 | ||
} | ||
|
||
// next beta release version. Output: 1.0.0-beta.1.rc.1 | ||
const nextBetaReleaseVesionFull = `${package.version}-beta.${issueNumber}.rc.${nextBetaReleaseVersion}` | ||
|
||
// update the beta version on package.json | ||
const { error } = await runCommand( | ||
`npm version ${nextBetaReleaseVesionFull} --no-git-tag-version`, | ||
) | ||
|
||
if (error) { | ||
console.error(error) | ||
return | ||
} | ||
|
||
// the beta version is already updated on package.json on the next line | ||
console.log('Next Beta version: ', `${nextBetaReleaseVesionFull}`) | ||
|
||
await runCommand(`echo "NEW_VERSION=${nextBetaReleaseVesionFull}" >> $GITHUB_ENV`) | ||
} |
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.
The AutoBetaRelease
function is well-structured and handles the beta release process effectively. However, consider adding error handling for JSON parsing and command execution failures to enhance robustness.
+ try {
+ const arrayOfBetaReleases = JSON.parse(stdout).filter((version) =>
+ version.includes(`${package.version}-beta.${issueNumber}`),
+ );
+ } catch (error) {
+ console.error('Failed to parse JSON:', error);
+ return;
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
const AutoBetaRelease = async () => { | |
// get all the versions of the package from npm | |
const { stdout } = await runCommand(`npm view . versions --json`) | |
// show npm published versions of this package | |
console.log(stdout) | |
// check if there is a beta release with the same issue number on published versions | |
const arrayOfBetaReleases = JSON.parse(stdout).filter((version) => | |
version.includes(`${package.version}-beta.${issueNumber}`), | |
) | |
let fullLastBetaRelease = null | |
// if yes, get the latest beta release. Output: 1.0.0-beta.1.rc.0 | |
if (arrayOfBetaReleases.length) { | |
fullLastBetaRelease = arrayOfBetaReleases[arrayOfBetaReleases.length - 1] | |
} | |
console.log('Last Beta Release: ', fullLastBetaRelease) | |
let nextBetaReleaseVersion = 0 | |
if (fullLastBetaRelease) { | |
const lastBetaReleaseRCVersionArray = fullLastBetaRelease.match(/rc.+[0-9]+/g) | |
const lastBetaReleaseRCVersion = | |
lastBetaReleaseRCVersionArray && lastBetaReleaseRCVersionArray.length | |
? lastBetaReleaseRCVersionArray[0] | |
: null | |
const lastBetaReleaseVersion = lastBetaReleaseRCVersion | |
? lastBetaReleaseRCVersion.split('.')[1] | |
: 0 | |
nextBetaReleaseVersion = parseInt(lastBetaReleaseVersion, 10) + 1 | |
} | |
// next beta release version. Output: 1.0.0-beta.1.rc.1 | |
const nextBetaReleaseVesionFull = `${package.version}-beta.${issueNumber}.rc.${nextBetaReleaseVersion}` | |
// update the beta version on package.json | |
const { error } = await runCommand( | |
`npm version ${nextBetaReleaseVesionFull} --no-git-tag-version`, | |
) | |
if (error) { | |
console.error(error) | |
return | |
} | |
// the beta version is already updated on package.json on the next line | |
console.log('Next Beta version: ', `${nextBetaReleaseVesionFull}`) | |
await runCommand(`echo "NEW_VERSION=${nextBetaReleaseVesionFull}" >> $GITHUB_ENV`) | |
} | |
const AutoBetaRelease = async () => { | |
// get all the versions of the package from npm | |
const { stdout } = await runCommand(`npm view . versions --json`) | |
// show npm published versions of this package | |
console.log(stdout) | |
// check if there is a beta release with the same issue number on published versions | |
try { | |
const arrayOfBetaReleases = JSON.parse(stdout).filter((version) => | |
version.includes(`${package.version}-beta.${issueNumber}`), | |
); | |
} catch (error) { | |
console.error('Failed to parse JSON:', error); | |
return; | |
} | |
let fullLastBetaRelease = null | |
// if yes, get the latest beta release. Output: 1.0.0-beta.1.rc.0 | |
if (arrayOfBetaReleases.length) { | |
fullLastBetaRelease = arrayOfBetaReleases[arrayOfBetaReleases.length - 1] | |
} | |
console.log('Last Beta Release: ', fullLastBetaRelease) | |
let nextBetaReleaseVersion = 0 | |
if (fullLastBetaRelease) { | |
const lastBetaReleaseRCVersionArray = fullLastBetaRelease.match(/rc.+[0-9]+/g) | |
const lastBetaReleaseRCVersion = | |
lastBetaReleaseRCVersionArray && lastBetaReleaseRCVersionArray.length | |
? lastBetaReleaseRCVersionArray[0] | |
: null | |
const lastBetaReleaseVersion = lastBetaReleaseRCVersion | |
? lastBetaReleaseRCVersion.split('.')[1] | |
: 0 | |
nextBetaReleaseVersion = parseInt(lastBetaReleaseVersion, 10) + 1 | |
} | |
// next beta release version. Output: 1.0.0-beta.1.rc.1 | |
const nextBetaReleaseVesionFull = `${package.version}-beta.${issueNumber}.rc.${nextBetaReleaseVersion}` | |
// update the beta version on package.json | |
const { error } = await runCommand( | |
`npm version ${nextBetaReleaseVesionFull} --no-git-tag-version`, | |
) | |
if (error) { | |
console.error(error) | |
return | |
} | |
// the beta version is already updated on package.json on the next line | |
console.log('Next Beta version: ', `${nextBetaReleaseVesionFull}`) | |
await runCommand(`echo "NEW_VERSION=${nextBetaReleaseVesionFull}" >> $GITHUB_ENV`) | |
} |
await runCommand(`echo "NEW_VERSION=${nextBetaReleaseVesionFull}" >> $GITHUB_ENV`) | ||
} | ||
|
||
AutoBetaRelease() |
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.
Consider wrapping the AutoBetaRelease
function call in a condition or exporting it as a module to provide more control over its execution.
+ if (require.main === module) {
+ AutoBetaRelease();
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
AutoBetaRelease() | |
if (require.main === module) { | |
AutoBetaRelease(); | |
} |
## [0.6.5](https://github.com/equinor/webviz-subsurface-components/compare/wsc-common@0.6.4...wsc-common@0.6.5) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [1.2.17](https://github.com/equinor/webviz-subsurface-components/compare/well-completions-plot@1.2.16...well-completions-plot@1.2.17) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [0.27.9](https://github.com/equinor/webviz-subsurface-components/compare/subsurface-viewer@0.27.8...subsurface-viewer@0.27.9) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [1.1.17](https://github.com/equinor/webviz-subsurface-components/compare/group-tree-plot@1.1.16...group-tree-plot@1.1.17) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [1.10.1](https://github.com/equinor/webviz-subsurface-components/compare/well-log-viewer@1.10.0...well-log-viewer@1.10.1) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
With the beta release workflow, all commits into the PR will trigger the beta release.
react-tooltip@{__VERSION__}-beta.{__PR_NUMBER__}.rc.{__BETA_VERSION__}
->react-tooltip@v0.0.11-beta.1.rc.1
https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
https://www.npmjs.com/package/auto-beta-release?activeTab=versions
Summary by CodeRabbit
minimist
) to improve command line parsing capabilities.