diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index dffc4d3..5652c0d 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,3 @@ +github: crazy-max patreon: crazymax custom: https://www.paypal.me/crazyws diff --git a/.prettierrc.json b/.prettierrc.json index f6736bc..1339e9b 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,11 +1,11 @@ { - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": true, - "singleQuote": true, - "trailingComma": "none", - "bracketSpacing": false, - "arrowParens": "avoid", - "parser": "typescript" - } \ No newline at end of file + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": false, + "arrowParens": "avoid", + "parser": "typescript" +} diff --git a/src/installer.ts b/src/installer.ts index 23ce148..0c65373 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -35,23 +35,14 @@ export async function getGoReleaser(version: string): Promise { extPath = await tc.extractTar(`${tmpdir}/${fileName}`); } - return path.join( - extPath, - osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser' - ); + return path.join(extPath, osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser'); } function getFileName(): string { - const platform: string = - osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux'; + const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux'; const arch: string = osArch == 'x64' ? 'x86_64' : 'i386'; const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz'; - const filename: string = util.format( - 'goreleaser_%s_%s.%s', - platform, - arch, - ext - ); + const filename: string = util.format('goreleaser_%s_%s.%s', platform, arch, ext); return filename; } @@ -60,24 +51,17 @@ interface GitHubRelease { } async function determineVersion(version: string): Promise { - let rest: restm.RestClient = new restm.RestClient( - 'goreleaser-action', - 'https://github.com', - undefined, - { - headers: { - Accept: 'application/json' - } + let rest: restm.RestClient = new restm.RestClient('goreleaser-action', 'https://github.com', undefined, { + headers: { + Accept: 'application/json' } - ); + }); let res: restm.IRestResponse = await rest.get( `/goreleaser/goreleaser/releases/${version}` ); if (res.statusCode != 200 || res.result === null) { - throw new Error( - `Cannot find GoReleaser ${version} release (http ${res.statusCode})` - ); + throw new Error(`Cannot find GoReleaser ${version} release (http ${res.statusCode})`); } return res.result.tag_name; diff --git a/src/main.ts b/src/main.ts index 169f8bd..cd7a1fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,10 +11,7 @@ export async function run(silent?: boolean) { const goreleaser = await installer.getGoReleaser(version); let snapshot = ''; - if ( - !process.env.GITHUB_REF || - !process.env.GITHUB_REF.startsWith('refs/tags/') - ) { + if (!process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) { console.log(`⚠️ No tag found. Snapshot forced`); if (!args.includes('--snapshot')) { snapshot = ' --snapshot';