mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-06-29 22:37:30 +00:00
Update prettier
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
|
github: crazy-max
|
||||||
patreon: crazymax
|
patreon: crazymax
|
||||||
custom: https://www.paypal.me/crazyws
|
custom: https://www.paypal.me/crazyws
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"printWidth": 80,
|
"printWidth": 120,
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"useTabs": false,
|
"useTabs": false,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
|
|||||||
+6
-22
@@ -35,23 +35,14 @@ export async function getGoReleaser(version: string): Promise<string> {
|
|||||||
extPath = await tc.extractTar(`${tmpdir}/${fileName}`);
|
extPath = await tc.extractTar(`${tmpdir}/${fileName}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return path.join(
|
return path.join(extPath, osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser');
|
||||||
extPath,
|
|
||||||
osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFileName(): string {
|
function getFileName(): string {
|
||||||
const platform: string =
|
const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
||||||
osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
|
||||||
const arch: string = osArch == 'x64' ? 'x86_64' : 'i386';
|
const arch: string = osArch == 'x64' ? 'x86_64' : 'i386';
|
||||||
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||||
const filename: string = util.format(
|
const filename: string = util.format('goreleaser_%s_%s.%s', platform, arch, ext);
|
||||||
'goreleaser_%s_%s.%s',
|
|
||||||
platform,
|
|
||||||
arch,
|
|
||||||
ext
|
|
||||||
);
|
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,24 +51,17 @@ interface GitHubRelease {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function determineVersion(version: string): Promise<string> {
|
async function determineVersion(version: string): Promise<string> {
|
||||||
let rest: restm.RestClient = new restm.RestClient(
|
let rest: restm.RestClient = new restm.RestClient('goreleaser-action', 'https://github.com', undefined, {
|
||||||
'goreleaser-action',
|
|
||||||
'https://github.com',
|
|
||||||
undefined,
|
|
||||||
{
|
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json'
|
Accept: 'application/json'
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
let res: restm.IRestResponse<GitHubRelease> = await rest.get<GitHubRelease>(
|
let res: restm.IRestResponse<GitHubRelease> = await rest.get<GitHubRelease>(
|
||||||
`/goreleaser/goreleaser/releases/${version}`
|
`/goreleaser/goreleaser/releases/${version}`
|
||||||
);
|
);
|
||||||
if (res.statusCode != 200 || res.result === null) {
|
if (res.statusCode != 200 || res.result === null) {
|
||||||
throw new Error(
|
throw new Error(`Cannot find GoReleaser ${version} release (http ${res.statusCode})`);
|
||||||
`Cannot find GoReleaser ${version} release (http ${res.statusCode})`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.result.tag_name;
|
return res.result.tag_name;
|
||||||
|
|||||||
+1
-4
@@ -11,10 +11,7 @@ export async function run(silent?: boolean) {
|
|||||||
const goreleaser = await installer.getGoReleaser(version);
|
const goreleaser = await installer.getGoReleaser(version);
|
||||||
|
|
||||||
let snapshot = '';
|
let snapshot = '';
|
||||||
if (
|
if (!process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
|
||||||
!process.env.GITHUB_REF ||
|
|
||||||
!process.env.GITHUB_REF.startsWith('refs/tags/')
|
|
||||||
) {
|
|
||||||
console.log(`⚠️ No tag found. Snapshot forced`);
|
console.log(`⚠️ No tag found. Snapshot forced`);
|
||||||
if (!args.includes('--snapshot')) {
|
if (!args.includes('--snapshot')) {
|
||||||
snapshot = ' --snapshot';
|
snapshot = ' --snapshot';
|
||||||
|
|||||||
Reference in New Issue
Block a user