forked from remix-run/react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): sync with remix (remix-run#9813)
* ci(release): sync with remix * ci: sync with remix * Delete postrelease.yml * ci: sync latest changes around getting previous release (cherry picked from commit a80a62d)
- Loading branch information
Showing
7 changed files
with
159 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* | ||
* @param {string | undefined} publishedPackages | ||
* @param {string | undefined} packageVersionToFollow | ||
* @returns {string | undefined} | ||
*/ | ||
function findReleaseFromChangeset(publishedPackages, packageVersionToFollow) { | ||
if (!publishedPackages) { | ||
throw new Error("No published packages found"); | ||
} | ||
|
||
let packages = JSON.parse(publishedPackages); | ||
|
||
if (!Array.isArray(packages)) { | ||
throw new Error("Published packages is not an array"); | ||
} | ||
|
||
/** @see https://github.com/changesets/action#outputs */ | ||
/** @type { { name: string; version: string }[] } */ | ||
let typed = packages.filter((pkg) => "name" in pkg && "version" in pkg); | ||
|
||
let found = typed.find((pkg) => pkg.name === packageVersionToFollow); | ||
|
||
if (!found) { | ||
throw new Error( | ||
`${packageVersionToFollow} was not found in the published packages` | ||
); | ||
} | ||
|
||
let result = `${found.name}@${found.version}`; | ||
console.log(result); | ||
return result; | ||
} | ||
|
||
findReleaseFromChangeset( | ||
process.env.publishedPackages, | ||
process.env.packageVersionToFollow | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters