Skip to content

Commit 06ef598

Browse files
authored
Merge pull request #72 from bcmi-labs/azure-service-connection-update
Switched to `typefox-service-account1`.
2 parents 6331b7d + cc6a0ae commit 06ef598

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
{
88
"type": "node",
99
"request": "launch",
10-
"name": "Launch Node.js Program",
11-
"program": "${file}"
10+
"name": "Launch Electron Packager",
11+
"program": "${workspaceRoot}/electron/packager/index.js",
12+
"cwd": "${workspaceFolder}/electron/packager"
1213
},
1314
{
1415
"type": "node",

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
downloadPath: 'gh-release'
7070
- task: GithubRelease@0
7171
inputs:
72-
gitHubConnection: personal-access-token-service-connection
72+
gitHubConnection: typefox-service-account1
7373
repositoryName: bcmi-labs/arduino-editor
7474
assets: |
7575
gh-release/Arduino-PoC - Applications/*.zip

electron/packager/index.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
//---------------------------+
3434
// rm -rf ../working-copy
3535
rm('-rf', path('..', workingCopy));
36-
// rm -rf ../build/dist
37-
rm('-rf', path('..', 'build', 'dist'));
38-
// rm -rf ../build/package.json
39-
rm('-rf', path('..', 'build', 'package.json'));
36+
// Clean up the `./electron/build` folder.
37+
shell.exec(`git -C ${path('..', 'build')} clean -ffxdq`, { async: false });
4038

4139
//----------------------------------------------------------------------------------------------+
4240
// Copy the following items into the `working-copy` folder. Make sure to reuse the `yarn.lock`. |
@@ -79,7 +77,7 @@
7977
pkg = require('../working-copy/electron-app/package.json');
8078
// @ts-ignore
8179
const template = require('../build/template-package.json');
82-
template.build.files = [ ...template.build.files, ...unusedDependencies.map(name => `!node_modules/${name}`) ];
80+
template.build.files = [...template.build.files, ...unusedDependencies.map(name => `!node_modules/${name}`)];
8381
pkg.dependencies = { ...pkg.dependencies, ...template.dependencies };
8482
pkg.devDependencies = { ...pkg.devDependencies, ...template.devDependencies };
8583
fs.writeFileSync(path('..', 'build', 'package.json'), JSON.stringify({
@@ -95,6 +93,17 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
9593
-----------------------
9694
`);
9795

96+
// Make sure the original `yarn.lock` file is used from the electron application.
97+
if (fs.existsSync(path('..', 'build', 'yarn.lock'))) {
98+
echo(`${path('..', 'build', 'yarn.lock')} must not exist.`);
99+
shell.exit(1);
100+
}
101+
cp('-rf', path(rootPath, 'yarn.lock'), path('..', 'build'));
102+
if (!fs.existsSync(path('..', 'build', 'yarn.lock'))) {
103+
echo(`${path('..', 'build', 'yarn.lock')} does not exist.`);
104+
shell.exit(1);
105+
}
106+
98107
//-------------------------------------------------------------------------------------------+
99108
// Install all private and public dependencies for the electron application and build Theia. |
100109
//-------------------------------------------------------------------------------------------+
@@ -109,7 +118,7 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
109118
rm('-rf', path('..', 'build', dotenv));
110119
}
111120
// For the releases we use the desired tag as is defined by `$(Release.Tag)` from Azure.
112-
// For the preview builds we use the version from the `electron/build/package.json` with the short commit hash.
121+
// For the preview builds we use the version from the `electron/build/package.json` with the short commit hash.
113122
fs.writeFileSync(path('..', 'build', dotenv), `ARDUINO_VERSION=${version}`);
114123

115124
//-----------------------------------+
@@ -186,4 +195,4 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
186195
return join(__dirname, ...paths);
187196
}
188197

189-
})();
198+
})();

0 commit comments

Comments
 (0)