Skip to content

Commit 29388ea

Browse files
committed
refactor: refactor release tags
1 parent 8c13a5f commit 29388ea

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/git.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default class Git extends CoreGit {
137137

138138
for ( const tag in tags ) {
139139
releaseTags[ tag ] = {
140-
"version": tags[ tag ].version?.version,
140+
"version": tags[ tag ].version,
141141
"action": null,
142142
};
143143

lib/package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export default class Package {
492492
if ( tags[ tag ].action === "update" ) {
493493
const annotation = this.createReleaseTagAnnotation( tag );
494494

495-
res = await this.git.exec( [ "tag", "--force", "--annotate", "--message", annotation, tag, "v" + tags[ tag ].version ] );
495+
res = await this.git.exec( [ "tag", "--force", "--annotate", "--message", annotation, tag, tags[ tag ].versionString ] );
496496
if ( !res.ok ) return res;
497497

498498
if ( this.git.upstream ) {
@@ -521,7 +521,7 @@ export default class Package {
521521
updated,
522522
"tags": Object.entries( tags ).reduce( ( tags, [ tag, { version, action } ] ) => {
523523
if ( version && action !== "delete" ) {
524-
tags[ tag ] = version;
524+
tags[ tag ] = version.versionString;
525525
}
526526

527527
return tags;

lib/package/npm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ export default class Npm {
237237
if ( SemanticVersion.isValid( tag ) ) continue;
238238

239239
if ( version && action !== "delete" ) {
240-
tags[ tag ] = version;
240+
tags[ tag ] = version.version;
241241
}
242242

243243
// set
244-
if ( version && remoteTags[ tag ] !== version ) {
245-
res = await this.api.setPackageTag( this.pkg.name, version, tag );
244+
if ( version && remoteTags[ tag ] !== version.version ) {
245+
res = await this.api.setPackageTag( this.pkg.name, version.version, tag );
246246

247247
if ( !res.ok ) {
248248
if ( res.data?.error?.code !== "E404" ) {

0 commit comments

Comments
 (0)