-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: fetch the tags and push each one individually #195
base: main
Are you sure you want to change the base?
Changes from all commits
8a9c902
1037916
a521ca5
71dd454
d538594
0e86e4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'changesets-gitlab': minor | ||
--- | ||
|
||
fetch the tags and push each one individually |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ interface PublishOptions { | |
script: string | ||
gitlabToken: string | ||
createGitlabReleases?: boolean | ||
pushAllTags?: boolean | ||
cwd?: string | ||
} | ||
|
||
|
@@ -82,6 +83,7 @@ export async function runPublish({ | |
script, | ||
gitlabToken, | ||
createGitlabReleases = true, | ||
pushAllTags = true, | ||
cwd = process.cwd(), | ||
}: PublishOptions): Promise<PublishResult> { | ||
const api = createApi(gitlabToken) | ||
|
@@ -93,7 +95,9 @@ export async function runPublish({ | |
{ cwd }, | ||
) | ||
|
||
await gitUtils.pushTags() | ||
if (pushAllTags) { | ||
await gitUtils.pushTags() | ||
} | ||
|
||
const { packages, tool } = await getPackages(cwd) | ||
const releasedPackages: Package[] = [] | ||
|
@@ -113,6 +117,11 @@ export async function runPublish({ | |
|
||
if (match) { | ||
releasedPackages.push(pkg) | ||
if (!pushAllTags) { | ||
await gitUtils.pushTag( | ||
`${pkg.packageJson.name}@${pkg.packageJson.version}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tag should be only And we can actually leave to use |
||
) | ||
} | ||
if (createGitlabReleases) { | ||
await createRelease(api, { | ||
pkg, | ||
|
@@ -142,6 +151,13 @@ export async function runPublish({ | |
} | ||
releasedPackages.push(pkg) | ||
} | ||
if (!pushAllTags) { | ||
for (const pkg of releasedPackages) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would |
||
await gitUtils.pushTag( | ||
`${pkg.packageJson.name}@${pkg.packageJson.version}`, | ||
) | ||
} | ||
} | ||
if (createGitlabReleases) { | ||
await Promise.all( | ||
releasedPackages.map(pkg => | ||
|
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.