Skip to content

Commit

Permalink
ci(shipjs): also push tags of non-published packages (#5230)
Browse files Browse the repository at this point in the history
<!--
  Thanks for submitting a pull request!
Please provide enough information so that others can review your pull
request.
-->

**Summary**

<!--
  Explain the **motivation** for making this change.
  What existing problem does the pull request solve?
  Are there any linked issues?
-->

These tags get used to determine the next version number, and as we
can't get rid of version number (yarn wouldn't include the package into
the dependencies otherwise), that's required to be correct.

This also fixes a little error in one example package accidentally set
to public

**Result**

<!--
  Demonstrate the code is solid.
  Example: The exact commands you ran and their output,
  screenshots / videos if the pull request changes UI.
-->

every package will get a git tag, to make sure the next version number
will be correct.
  • Loading branch information
Haroenv committed Dec 23, 2022
1 parent c04e988 commit 9d4970e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build/
# Unneeded changelogs
examples/*/*/CHANGELOG.md
tests/*/CHANGELOG.md
scripts/*/CHANGELOG.md

# Logs
*.log
Expand Down
1 change: 1 addition & 0 deletions scripts/website/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "example-react-instantsearch-builder",
"private": true,
"version": "1.0.0",
"license": "MIT",
"scripts": {
Expand Down
13 changes: 6 additions & 7 deletions ship.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
const shell = require('shelljs');

const packages = JSON.parse(
shell.exec('yarn run --silent lerna list --toposort --json --no-private', {
shell.exec('yarn run --silent lerna list --toposort --json', {
silent: true,
})
);

module.exports = {
shouldPrepare: ({ releaseType, commitNumbersPerType }) => {
const { fix = 0 } = commitNumbersPerType;
if (releaseType === 'patch' && fix === 0) {
return false;
}
shouldPrepare: () => {
return true;
},
getTagName: () =>
Expand All @@ -23,7 +19,10 @@ module.exports = {
);

return {
// This is used for shouldPrepare
// This version number is used for shouldPrepare.
// for it to be useful, we need to chang shipjs to accept an array of nextVersions
// @TODO: update this to packages.map(package => package.version) once it's supported in shipjs
// see https://github.com/algolia/shipjs/issues/986
nextVersion: packages[0].version,
};
},
Expand Down

0 comments on commit 9d4970e

Please sign in to comment.