@@ -1072,7 +1072,7 @@ const os = __webpack_require__(87);
1072
1072
const path = __webpack_require__(622);
1073
1073
const fs = __webpack_require__(747);
1074
1074
const Utils = __webpack_require__(353);
1075
- const ArtifactsManager = __webpack_require__(513 );
1075
+ const ArtifactsManager = __webpack_require__(275 );
1076
1076
const constants = __webpack_require__(613);
1077
1077
1078
1078
const {
@@ -1107,15 +1107,21 @@ class BinaryControl {
1107
1107
* platform and the architecture
1108
1108
*/
1109
1109
_decidePlatformAndBinary() {
1110
- if (this.platform === PLATFORMS.DARWIN) {
1111
- this.binaryLink = BINARY_LINKS.DARWIN;
1112
- this.binaryFolder = path.resolve(process.env.HOME, 'work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
1113
- } else if (this.platform === PLATFORMS.LINUX) {
1114
- this.binaryLink = os.arch() === 'x32' ? BINARY_LINKS.LINUX_32 : BINARY_LINKS.LINUX_64;
1115
- this.binaryFolder = path.resolve(process.env.HOME, 'work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
1116
- } else if (this.platform === PLATFORMS.WIN32) {
1117
- this.binaryLink = BINARY_LINKS.WINDOWS;
1118
- this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', 'work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
1110
+ switch (this.platform) {
1111
+ case PLATFORMS.DARWIN:
1112
+ this.binaryLink = BINARY_LINKS.DARWIN;
1113
+ this.binaryFolder = path.resolve(process.env.HOME, 'work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
1114
+ break;
1115
+ case PLATFORMS.LINUX:
1116
+ this.binaryLink = os.arch() === 'x32' ? BINARY_LINKS.LINUX_32 : BINARY_LINKS.LINUX_64;
1117
+ this.binaryFolder = path.resolve(process.env.HOME, 'work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
1118
+ break;
1119
+ case PLATFORMS.WIN32:
1120
+ this.binaryLink = BINARY_LINKS.WINDOWS;
1121
+ this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', 'work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
1122
+ break;
1123
+ default:
1124
+ throw Error(`Unsupported Platform: ${this.platform}. No BrowserStackLocal binary found.`);
1119
1125
}
1120
1126
}
1121
1127
@@ -1205,11 +1211,11 @@ class BinaryControl {
1205
1211
* Downloads the Local Binary, extracts it and adds it in the PATH variable
1206
1212
*/
1207
1213
async downloadBinary() {
1214
+ if (Utils.checkToolInCache(LOCAL_BINARY_NAME)) {
1215
+ core.info('BrowserStackLocal binary already exists in cache. Using that instead of downloading again...');
1216
+ return;
1217
+ }
1208
1218
try {
1209
- if (Utils.checkToolInCache(LOCAL_BINARY_NAME)) {
1210
- core.info('BrowserStackLocal binary already exists in cache. Using that instead of downloading again...');
1211
- return;
1212
- }
1213
1219
await this._makeDirectory();
1214
1220
core.info('Downloading BrowserStackLocal binary...');
1215
1221
const downloadPath = await tc.downloadTool(this.binaryLink, path.resolve(this.binaryFolder, 'binaryZip'));
@@ -4986,6 +4992,40 @@ class Context {
4986
4992
exports.Context = Context;
4987
4993
//# sourceMappingURL=context.js.map
4988
4994
4995
+ /***/ }),
4996
+
4997
+ /***/ 275:
4998
+ /***/ (function(module, __unusedexports, __webpack_require__) {
4999
+
5000
+ const artifact = __webpack_require__(214);
5001
+ const core = __webpack_require__(470);
5002
+
5003
+ class ArtifactsManager {
5004
+ /**
5005
+ * Upload artifacts to GitHub workflow
5006
+ * @param {String} artifactName Name by which the artifact should be available post uploading
5007
+ * @param {String[]} files Files to upload
5008
+ * @param {String} rootFolder Folder in which the files reside
5009
+ * @returns {Promise<artifact.UploadResponse>} Response of the upload operation
5010
+ */
5011
+ static async uploadArtifacts(artifactName, files, rootFolder) {
5012
+ const artifactClient = artifact.create();
5013
+ const response = await artifactClient.uploadArtifact(
5014
+ artifactName,
5015
+ files,
5016
+ rootFolder, {
5017
+ continueOnError: true,
5018
+ },
5019
+ );
5020
+ core.info(`Response for upload: ${JSON.stringify(response)}`);
5021
+ return response;
5022
+ }
5023
+ }
5024
+
5025
+ // eslint-disable-next-line import/prefer-default-export
5026
+ module.exports = ArtifactsManager;
5027
+
5028
+
4989
5029
/***/ }),
4990
5030
4991
5031
/***/ 280:
@@ -11143,40 +11183,6 @@ function addHook (state, kind, name, hook) {
11143
11183
}
11144
11184
11145
11185
11146
- /***/ }),
11147
-
11148
- /***/ 513:
11149
- /***/ (function(module, __unusedexports, __webpack_require__) {
11150
-
11151
- const artifact = __webpack_require__(214);
11152
- const core = __webpack_require__(470);
11153
-
11154
- class ArtifactsManager {
11155
- /**
11156
- * Upload artifacts to GitHub workflow
11157
- * @param {String} artifactName Name by which the artifact should be available post uploading
11158
- * @param {String[]} files Files to upload
11159
- * @param {String} rootFolder Folder in which the files reside
11160
- * @returns {Promise<artifact.UploadResponse>} Response of the upload operation
11161
- */
11162
- static async uploadArtifacts(artifactName, files, rootFolder) {
11163
- const artifactClient = artifact.create();
11164
- const response = await artifactClient.uploadArtifact(
11165
- artifactName,
11166
- files,
11167
- rootFolder, {
11168
- continueOnError: true,
11169
- },
11170
- );
11171
- core.info(`Response for upload: ${JSON.stringify(response)}`);
11172
- return response;
11173
- }
11174
- }
11175
-
11176
- // eslint-disable-next-line import/prefer-default-export
11177
- module.exports = ArtifactsManager;
11178
-
11179
-
11180
11186
/***/ }),
11181
11187
11182
11188
/***/ 521:
@@ -13975,8 +13981,8 @@ const {
13975
13981
* Entry point to initiate the Action.
13976
13982
* 1. Triggers parsing of action input values
13977
13983
* 2. Decides requirement of Local Binary
13978
- * 3. Start/Stop Local Binary if required
13979
- * 4. Triggers uploading of artifacts
13984
+ * 3. Start/Stop Local Binary
13985
+ * 4. Triggers uploading of artifacts after stopping binary
13980
13986
*/
13981
13987
const run = async () => {
13982
13988
try {
@@ -16953,7 +16959,7 @@ class ActionInput {
16953
16959
16954
16960
/**
16955
16961
* Triggers conditional validation of action input values based on the operation
16956
- * to be performed, i.e. start/no local connection required, stopping of local connection
16962
+ * to be performed, i.e. starting/ stopping of local connection
16957
16963
*/
16958
16964
_validateInput() {
16959
16965
this.localTesting = InputValidator.validateLocalTesting(this.localTesting);
0 commit comments