Skip to content

Commit f3ba962

Browse files
author
Engin Diri
authored
chore: fix latest handling (#7)
Signed-off-by: Engin Diri <[email protected]>
1 parent 5fe4ec0 commit f3ba962

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

goreleaserTask/src/utils.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ export async function getGoReleaserCLI(version, distribution: string) {
9393
if (response.data != undefined) {
9494
const tagsData = response.data.map((obj) => obj.tag_name);
9595
let checkedVersion;
96-
if (version === 'latest' || !isPro(distribution)) {
97-
checkedVersion = semver.maxSatisfying(tagsData, '*');
96+
const cleanTags: Array<string> = tagsData.map((tag) =>
97+
cleanTag(tag),
98+
);
99+
if (version === 'latest') {
100+
console.log("here")
101+
checkedVersion = semver.maxSatisfying(cleanTags, '*');
102+
if (isPro(distribution)) {
103+
checkedVersion += suffix(distribution);
104+
}
105+
98106
} else {
99-
const cleanTags: Array<string> = tagsData.map((tag) =>
100-
cleanTag(tag),
101-
);
107+
102108
const cleanVersion: string = cleanTag(version);
103109
checkedVersion =
104110
semver.maxSatisfying(cleanTags, cleanVersion) +

goreleaserTask/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"version": {
1212
"Major": 0,
1313
"Minor": 1,
14-
"Patch": 7
14+
"Patch": 8
1515
},
1616
"instanceNameFormat": "GoReleaser is a release automation tool for Go projects",
1717
"inputs": [

vss-extension.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "goreleaser-azure-devops-extension",
44
"name": "GoReleaser",
5-
"version": "0.1.7",
5+
"version": "0.1.8",
66
"publisher": "goreleaser-azure-devops-extension",
77
"targets": [
88
{

0 commit comments

Comments
 (0)