@@ -134,7 +134,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
134
134
});
135
135
};
136
136
Object.defineProperty(exports, "__esModule", ({ value: true }));
137
- exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
137
+ exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports. warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
138
138
const command_1 = __nccwpck_require__(5241);
139
139
const file_command_1 = __nccwpck_require__(717);
140
140
const utils_1 = __nccwpck_require__(5278);
@@ -312,19 +312,30 @@ exports.debug = debug;
312
312
/**
313
313
* Adds an error issue
314
314
* @param message error issue message. Errors will be converted to string via toString()
315
+ * @param properties optional properties to add to the annotation.
315
316
*/
316
- function error(message) {
317
- command_1.issue ('error', message instanceof Error ? message.toString() : message);
317
+ function error(message, properties = {} ) {
318
+ command_1.issueCommand ('error', utils_1.toCommandProperties(properties) , message instanceof Error ? message.toString() : message);
318
319
}
319
320
exports.error = error;
320
321
/**
321
- * Adds an warning issue
322
+ * Adds a warning issue
322
323
* @param message warning issue message. Errors will be converted to string via toString()
324
+ * @param properties optional properties to add to the annotation.
323
325
*/
324
- function warning(message) {
325
- command_1.issue ('warning', message instanceof Error ? message.toString() : message);
326
+ function warning(message, properties = {} ) {
327
+ command_1.issueCommand ('warning', utils_1.toCommandProperties(properties) , message instanceof Error ? message.toString() : message);
326
328
}
327
329
exports.warning = warning;
330
+ /**
331
+ * Adds a notice issue
332
+ * @param message notice issue message. Errors will be converted to string via toString()
333
+ * @param properties optional properties to add to the annotation.
334
+ */
335
+ function notice(message, properties = {}) {
336
+ command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
337
+ }
338
+ exports.notice = notice;
328
339
/**
329
340
* Writes info to log with console.log.
330
341
* @param message info message
@@ -458,7 +469,7 @@ exports.issueCommand = issueCommand;
458
469
// We use any as a valid input type
459
470
/* eslint-disable @typescript-eslint/no-explicit-any */
460
471
Object.defineProperty(exports, "__esModule", ({ value: true }));
461
- exports.toCommandValue = void 0;
472
+ exports.toCommandProperties = exports. toCommandValue = void 0;
462
473
/**
463
474
* Sanitizes an input into a string so it can be passed into issueCommand safely
464
475
* @param input input to sanitize into a string
@@ -473,6 +484,25 @@ function toCommandValue(input) {
473
484
return JSON.stringify(input);
474
485
}
475
486
exports.toCommandValue = toCommandValue;
487
+ /**
488
+ *
489
+ * @param annotationProperties
490
+ * @returns The command properties to send with the actual annotation command
491
+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
492
+ */
493
+ function toCommandProperties(annotationProperties) {
494
+ if (!Object.keys(annotationProperties).length) {
495
+ return {};
496
+ }
497
+ return {
498
+ title: annotationProperties.title,
499
+ line: annotationProperties.startLine,
500
+ endLine: annotationProperties.endLine,
501
+ col: annotationProperties.startColumn,
502
+ endColumn: annotationProperties.endColumn
503
+ };
504
+ }
505
+ exports.toCommandProperties = toCommandProperties;
476
506
//# sourceMappingURL=utils.js.map
477
507
478
508
/***/ }),
@@ -12829,7 +12859,7 @@ function wrappy (fn, cb) {
12829
12859
12830
12860
/***/ }),
12831
12861
12832
- /***/ 3997 :
12862
+ /***/ 5765 :
12833
12863
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
12834
12864
12835
12865
"use strict";
@@ -12849,7 +12879,7 @@ var core = __nccwpck_require__(2186);
12849
12879
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
12850
12880
var github = __nccwpck_require__(5438);
12851
12881
;// CONCATENATED MODULE: ./package.json
12852
- const package_namespaceObject = {"i8":"2.0.3 "};
12882
+ const package_namespaceObject = {"i8":"2.1.0 "};
12853
12883
;// CONCATENATED MODULE: ./src/buildExec.ts
12854
12884
12855
12885
@@ -12884,8 +12914,9 @@ const buildExec = () => {
12884
12914
const searchDir = core.getInput('directory');
12885
12915
const slug = core.getInput('slug');
12886
12916
const token = core.getInput('token');
12887
- const verbose = isTrue( core.getInput('verbose') );
12917
+ let uploaderVersion = core.getInput('version' );
12888
12918
const url = core.getInput('url');
12919
+ const verbose = isTrue(core.getInput('verbose'));
12889
12920
const workingDir = core.getInput('working-directory');
12890
12921
const execArgs = [];
12891
12922
execArgs.push('-n', `${name}`, '-Q', `github-action-${package_namespaceObject.i8}`);
@@ -12982,7 +13013,10 @@ const buildExec = () => {
12982
13013
if (workingDir) {
12983
13014
options.cwd = workingDir;
12984
13015
}
12985
- return { execArgs, options, failCi, os };
13016
+ if (uploaderVersion == '') {
13017
+ uploaderVersion = 'latest';
13018
+ }
13019
+ return { execArgs, options, failCi, os, uploaderVersion };
12986
13020
};
12987
13021
/* harmony default export */ const src_buildExec = (buildExec);
12988
13022
@@ -13023,8 +13057,8 @@ const getPlatform = (os) => {
13023
13057
core.info('==> Could not detect OS or provided OS is invalid. Defaulting to linux');
13024
13058
return 'linux';
13025
13059
};
13026
- const getBaseUrl = (platform) => {
13027
- return `https://uploader.codecov.io/latest /${platform}/${getUploaderName(platform)}`;
13060
+ const getBaseUrl = (platform, version ) => {
13061
+ return `https://uploader.codecov.io/${version} /${platform}/${getUploaderName(platform)}`;
13028
13062
};
13029
13063
13030
13064
@@ -13051,15 +13085,16 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
13051
13085
13052
13086
13053
13087
13054
- const verify = (filename, platform) => __awaiter(void 0, void 0, void 0, function* () {
13088
+ const verify = (filename, platform, version ) => __awaiter(void 0, void 0, void 0, function* () {
13055
13089
try {
13056
13090
const uploaderName = getUploaderName(platform);
13057
13091
// Read in public key
13058
13092
const publicKeyArmored = yield external_fs_.readFileSync(__nccwpck_require__.ab + "pgp_keys.asc", 'utf-8');
13059
13093
// Get SHASUM and SHASUM signature files
13060
- const shasumRes = yield lib(`${getBaseUrl(platform)}.SHA256SUM`);
13094
+ console.log(`${getBaseUrl(platform, version)}.SHA256SUM`);
13095
+ const shasumRes = yield lib(`${getBaseUrl(platform, version)}.SHA256SUM`);
13061
13096
const shasum = yield shasumRes.text();
13062
- const shaSigRes = yield lib(`${getBaseUrl(platform)}.SHA256SUM.sig`);
13097
+ const shaSigRes = yield lib(`${getBaseUrl(platform, version )}.SHA256SUM.sig`);
13063
13098
const shaSig = yield shaSigRes.text();
13064
13099
// Verify shasum
13065
13100
const verified = yield openpgp_min/* verify */.T({
@@ -13099,6 +13134,35 @@ const verify = (filename, platform) => __awaiter(void 0, void 0, void 0, functio
13099
13134
});
13100
13135
/* harmony default export */ const validate = (verify);
13101
13136
13137
+ ;// CONCATENATED MODULE: ./src/version.ts
13138
+ var version_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
13139
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13140
+ return new (P || (P = Promise))(function (resolve, reject) {
13141
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
13142
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13143
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13144
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
13145
+ });
13146
+ };
13147
+
13148
+
13149
+ const versionInfo = (platform, version) => version_awaiter(void 0, void 0, void 0, function* () {
13150
+ if (version) {
13151
+ core.info(`==> Running version ${version}`);
13152
+ }
13153
+ try {
13154
+ const metadataRes = yield lib(`https://uploader.codecov.io/${platform}/latest`, {
13155
+ headers: { 'Accept': 'application/json' },
13156
+ });
13157
+ const metadata = yield metadataRes.json();
13158
+ core.info(`==> Running version ${metadata['version']}`);
13159
+ }
13160
+ catch (err) {
13161
+ core.info(`Could not pull latest version information: ${err}`);
13162
+ }
13163
+ });
13164
+ /* harmony default export */ const version = (versionInfo);
13165
+
13102
13166
;// CONCATENATED MODULE: ./src/index.ts
13103
13167
var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
13104
13168
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -13116,12 +13180,13 @@ var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argu
13116
13180
13117
13181
13118
13182
13183
+
13119
13184
let failCi;
13120
13185
try {
13121
- const { execArgs, options, failCi, os } = src_buildExec();
13186
+ const { execArgs, options, failCi, os, uploaderVersion } = src_buildExec();
13122
13187
const platform = getPlatform(os);
13123
13188
const filename = external_path_.join(__dirname, getUploaderName(platform));
13124
- external_https_.get(getBaseUrl(platform), (res) => {
13189
+ external_https_.get(getBaseUrl(platform, uploaderVersion ), (res) => {
13125
13190
// Image will be stored at this path
13126
13191
const filePath = external_fs_.createWriteStream(filename);
13127
13192
res.pipe(filePath);
@@ -13130,7 +13195,8 @@ try {
13130
13195
setFailure(`Codecov: Failed to write uploader binary: ${err.message}`, true);
13131
13196
}).on('finish', () => src_awaiter(void 0, void 0, void 0, function* () {
13132
13197
filePath.close();
13133
- yield validate(filename, platform);
13198
+ yield validate(filename, platform, uploaderVersion);
13199
+ yield version(platform, uploaderVersion);
13134
13200
yield external_fs_.chmodSync(filename, '777');
13135
13201
const unlink = () => {
13136
13202
external_fs_.unlink(filename, (err) => {
@@ -13372,7 +13438,7 @@ module.exports = require("zlib");
13372
13438
/******/ // startup
13373
13439
/******/ // Load entry module and return exports
13374
13440
/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined
13375
- /******/ var __webpack_exports__ = __nccwpck_require__(3997 );
13441
+ /******/ var __webpack_exports__ = __nccwpck_require__(5765 );
13376
13442
/******/ module.exports = __webpack_exports__;
13377
13443
/******/
13378
13444
/******/ })()
0 commit comments