-
Notifications
You must be signed in to change notification settings - Fork 62
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
ci: add deprecate workflow #846
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
176a9ef
ci: add deprecate workflow
dpilch b678d29
ci: use storeCacheForLinuxBuildJob
dpilch c3e2fc1
ci: use correct script path
dpilch b792c24
ci: fix startLocalRegistry command
dpilch 8f20e97
ci: upgrade verdaccio
dpilch ac0027d
build: move postinstall to bash script
dpilch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,8 @@ | ||
version: 0.2 | ||
env: | ||
shell: bash | ||
git-credential-helper: yes | ||
phases: | ||
build: | ||
commands: | ||
- source ./shared-scripts.sh && _deprecate |
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,14 @@ | ||
version: 0.2 | ||
env: | ||
shell: bash | ||
compute-type: BUILD_GENERAL1_SMALL | ||
|
||
batch: | ||
fast-fail: false | ||
build-graph: | ||
- identifier: install_linux | ||
buildspec: .codebuild/install_linux.yml | ||
- identifier: deprecate | ||
buildspec: .codebuild/deprecate.yml | ||
depend-on: | ||
- install_linux |
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,10 @@ | ||
version: 0.2 | ||
env: | ||
shell: bash | ||
phases: | ||
build: | ||
commands: | ||
- source ./shared-scripts.sh && _installLinux | ||
artifacts: | ||
files: | ||
- 'shared-scripts.sh' |
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
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,59 @@ | ||
import { EOL } from 'os'; | ||
import { NpmClient } from './npm_client.js'; | ||
import { releaseTagToNameAndVersion } from './release_tag_to_name_and_version'; | ||
|
||
type DistTagMoveAction = { | ||
/** | ||
* An NPM dist-tag | ||
*/ | ||
distTag: string; | ||
/** | ||
* This is a string of the form <packageName>@<version> | ||
*/ | ||
releaseTag: string; | ||
}; | ||
|
||
/** | ||
* Handles moving npm dist-tags from one package version to another | ||
*/ | ||
export class DistTagMover { | ||
/** | ||
* Initialize with an npmClient | ||
*/ | ||
constructor(private readonly npmClient: NpmClient) {} | ||
|
||
/** | ||
* Given a list of sourceReleaseTags and destReleaseTags, | ||
* any npm dist-tags that are pointing to a sourceReleaseTag will be moved to point to the corresponding destReleaseTag | ||
*/ | ||
moveDistTags = async (sourceReleaseTags: string[], destReleaseTags: string[]) => { | ||
const moveActions: DistTagMoveAction[] = []; | ||
|
||
for (const sourceReleaseTag of sourceReleaseTags) { | ||
const { packageName, version: sourceVersion } = releaseTagToNameAndVersion(sourceReleaseTag); | ||
|
||
const { 'dist-tags': distTags } = await this.npmClient.getPackageInfo(sourceReleaseTag); | ||
|
||
Object.entries(distTags).forEach(([tagName, versionAtTag]) => { | ||
if (versionAtTag !== sourceVersion) { | ||
return; | ||
} | ||
const destReleaseTag = destReleaseTags.find(releaseTag => releaseTag.includes(packageName)); | ||
if (!destReleaseTag) { | ||
console.warn(`No corresponding destination release tag found for ${sourceReleaseTag}. latest tag not moved.`); | ||
} else { | ||
moveActions.push({ | ||
releaseTag: destReleaseTag, | ||
distTag: tagName, | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
for (const { distTag, releaseTag } of moveActions) { | ||
console.log(`Moving dist tag "${distTag}" to release tag ${releaseTag}`); | ||
await this.npmClient.setDistTag(releaseTag, distTag); | ||
console.log(`Done!${EOL}`); | ||
} | ||
}; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are these the arguments to
yarn trigger-deprecate-release
script?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.
Yes