improvement: Review snapshot behavior (#95)

* Improve git tag detection (#77)
* Only handle snapshot flag for release cmd (#94)
* Use core.info instead of console.log
* Update gitattributes
This commit is contained in:
CrazyMax
2020-02-11 13:52:06 +01:00
committed by GitHub
parent 81d25e3b66
commit e198786300
8 changed files with 123 additions and 30 deletions
+5 -5
View File
@@ -16,6 +16,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const tc = __importStar(require("@actions/tool-cache"));
const download = __importStar(require("download"));
const fs = __importStar(require("fs"));
@@ -31,13 +32,13 @@ function getGoReleaser(version) {
if (selected) {
version = selected;
}
console.log(`✅ GoReleaser version found: ${version}`);
core.info(`✅ GoReleaser version found: ${version}`);
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'goreleaser-'));
const fileName = getFileName();
const downloadUrl = util.format('https://github.com/goreleaser/goreleaser/releases/download/%s/%s', version, fileName);
console.log(`⬇️ Downloading ${downloadUrl}...`);
core.info(`⬇️ Downloading ${downloadUrl}...`);
yield download.default(downloadUrl, tmpdir, { filename: fileName });
console.log('📦 Extracting GoReleaser...');
core.info('📦 Extracting GoReleaser...');
let extPath = tmpdir;
if (osPlat == 'win32') {
extPath = yield tc.extractZip(`${tmpdir}/${fileName}`);
@@ -53,8 +54,7 @@ function getFileName() {
const platform = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
const arch = osArch == 'x64' ? 'x86_64' : 'i386';
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
const filename = util.format('goreleaser_%s_%s.%s', platform, arch, ext);
return filename;
return util.format('goreleaser_%s_%s.%s', platform, arch, ext);
}
function determineVersion(version) {
return __awaiter(this, void 0, void 0, function* () {