Skip to content

Commit

Permalink
Fix/release ci actions (#378)
Browse files Browse the repository at this point in the history
* fix ci workflows

* allow new project without serial ports

* fix report version

Co-authored-by: Brian Ignacio <brian.ignacio@espressif.com>
  • Loading branch information
brianignacio5 and brianignacio5 authored Apr 23, 2021
1 parent 0357260 commit eea59a9
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 27 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ jobs:
- name: Lint Check
run: yarn lint

- name: Package .vsix
run: yarn package

- name: Upload .vsix File
uses: actions/upload-artifact@v1
with:
name: esp-idf-extension.vsix
path: esp-idf-extension.vsix

- name: Package open .vsix
run: yarn packageWithoutDependencies

Expand All @@ -54,6 +45,15 @@ jobs:
name: esp-idf-extension-open.vsix
path: esp-idf-extension-open.vsix

- name: Package .vsix
run: yarn package

- name: Upload .vsix File
uses: actions/upload-artifact@v1
with:
name: esp-idf-extension.vsix
path: esp-idf-extension.vsix

- name: Extension Test
uses: GabrielBB/xvfb-action@v1.2
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
- name: Install Dependencies
run: yarn

- name: Package open .vsix
run: yarn run packageWithoutDependencies

- name: VSIX Package
run: yarn run package

Expand Down Expand Up @@ -56,6 +59,17 @@ jobs:
asset_name: esp-idf-extension-${{ steps.version.outputs.version }}.vsix
asset_content_type: application/zip

- name: Upload no dependencies release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./esp-idf-extension-open.vsix
asset_name: esp-idf-extension-open-${{ steps.version.outputs.version }}.vsix
asset_content_type: application/zip

- name: Marketplace release
run: yarn run release
env:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@
"watch": "webpack --watch --mode development",
"test": "tsc -p ./ && node ./out/test/runTest.js --VERBOSE 2>&1 >> testing.results.log",
"package": "vsce package --yarn -o esp-idf-extension.vsix",
"release": "vsce publish --yarn -p ${VS_MARKETPLACE_TOKEN}",
"release": "vsce publish --yarn -p ${VS_MARKETPLACE_TOKEN} --packagePath esp-idf-extension.vsix",
"clean": "gulp clean",
"validateLocalization": "gulp validateLocalization",
"webpack": "webpack --mode production",
Expand Down
29 changes: 27 additions & 2 deletions src/newProject/newProjectInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ const defTargetList: IdfTarget[] = [
name: "ESP32-S2",
openOcdFiles: "interface/ftdi/esp32_devkitj_v1.cfg,target/esp32s2.cfg",
} as IdfTarget,
{
id: "esp32s3",
name: "ESP32-S3",
openOcdFiles: "interface/ftdi/esp32_devkitj_v1.cfg,target/esp32s3.cfg",
} as IdfTarget,
{
id: "esp32c3",
name: "ESP32-C3 USB",
openOcdFiles: "board/esp32c3-builtin.cfg",
} as IdfTarget,
{
id: "esp32c3",
name: "ESP32-C3 PROG",
openOcdFiles: "board/esp32c3-ftdi.cfg",
} as IdfTarget,
];

export async function getBoards() {
Expand Down Expand Up @@ -96,8 +111,18 @@ export async function getNewProjectArgs(
progress.report({ increment: 10, message: "Loading ESP-IDF components..." });
const components = [];
progress.report({ increment: 10, message: "Loading serial ports..." });
const serialPortListDetails = await SerialPort.shared().getListArray();
const serialPortList = serialPortListDetails.map((p) => p.comName);
let serialPortList: Array<string>;
try {
const serialPortListDetails = await SerialPort.shared().getListArray();
serialPortList = serialPortListDetails.map((p) => p.comName);
} catch (error) {
const msg = error.message
? error.message
: "Error looking for serial ports.";
Logger.infoNotify(msg);
Logger.error(msg, error);
serialPortList = ["no port"];
}
progress.report({ increment: 10, message: "Loading ESP-IDF Boards list..." });
const espBoards = await getBoards();
progress.report({ increment: 10, message: "Loading ESP-IDF Target list..." });
Expand Down
37 changes: 25 additions & 12 deletions src/newProject/newProjectPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import marked from "marked";
import * as path from "path";
import * as vscode from "vscode";
import * as idfConf from "../idfConfiguration";
Expand Down Expand Up @@ -272,18 +271,32 @@ export class NewProjectPanel {
const toolsDir = idfConf.readParameter("idf.toolsPath");
const pyPath = idfConf.readParameter("idf.pythonBinPath");
const isWin = process.platform === "win32" ? "Win" : "";
const modifiedEnv = utils.appendIdfAndToolsToPath();
const idfTarget = modifiedEnv.IDF_TARGET || "esp32";
settingsJson["idf.adapterTargetName"] = idfTarget;
settingsJson["idf.customExtraPaths"] = extraPaths;
settingsJson["idf.customExtraVars"] = extraVars;
settingsJson["idf.espIdfPath" + isWin] = idfPathDir;
settingsJson["idf.espAdfPath" + isWin] = adfPathDir;
settingsJson["idf.espMdfPath" + isWin] = mdfPathDir;
settingsJson["idf.adapterTargetName"] = idfTarget || "esp32";
if (extraPaths) {
settingsJson["idf.customExtraPaths"] = extraPaths;
}
if (extraVars) {
settingsJson["idf.customExtraVars"] = extraVars;
}
if (idfPathDir) {
settingsJson["idf.espIdfPath" + isWin] = idfPathDir;
}
if (adfPathDir) {
settingsJson["idf.espAdfPath" + isWin] = adfPathDir;
}
if (mdfPathDir) {
settingsJson["idf.espMdfPath" + isWin] = mdfPathDir;
}
settingsJson["idf.openOcdConfigs"] = openOcdConfigs;
settingsJson["idf.port" + isWin] = port;
settingsJson["idf.pythonBinPath" + isWin] = pyPath;
settingsJson["idf.toolsPath" + isWin] = toolsDir;
if (port.indexOf("no port") === -1) {
settingsJson["idf.port" + isWin] = port;
}
if (pyPath) {
settingsJson["idf.pythonBinPath" + isWin] = pyPath;
}
if (toolsDir) {
settingsJson["idf.toolsPath" + isWin] = toolsDir;
}
await writeJSON(settingsJsonPath, settingsJson, {
spaces:
vscode.workspace.getConfiguration().get("editor.tabSize") || 2,
Expand Down
4 changes: 2 additions & 2 deletions src/support/writeReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export async function writeTextReport(
const lineBreak = `--------------------------------------------------------------------------------------------------------------------------------------------${EOL}`;
output += `OS ${reportedResult.systemInfo.platform} ${reportedResult.systemInfo.architecture} ${reportedResult.systemInfo.systemName} ${EOL}`;
output += `System environment variable PATH ${EOL} ${reportedResult.systemInfo.envPath} ${EOL}`;
output += `Visual Studio Code version ${reportedResult.systemInfo.extensionVersion} ${EOL}`;
output += `Visual Studio Code version ${reportedResult.systemInfo.vscodeVersion} ${EOL}`;
output += `Visual Studio Code language ${reportedResult.systemInfo.language} ${EOL}`;
output += `Visual Studio Code shell ${reportedResult.systemInfo.shell} ${EOL}`;
output += `ESP-IDF Extension version ${reportedResult.systemInfo.vscodeVersion} ${EOL}`;
output += `ESP-IDF Extension version ${reportedResult.systemInfo.extensionVersion} ${EOL}`;
output += `---------------------------------------------------- Extension configuration settings ------------------------------------------------------${EOL}`;
output += `ESP-IDF Path (idf.espIdfPath) ${reportedResult.configurationSettings.espIdfPath}${EOL}`;
output += `Custom extra paths (idf.customExtraPaths) ${reportedResult.configurationSettings.customExtraPaths}${EOL}`;
Expand Down
2 changes: 1 addition & 1 deletion src/views/new-project/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const actions: ActionTree<IState, any> = {
openOcdConfigFiles: context.state.openOcdConfigFiles,
port: context.state.selectedPort,
projectName: context.state.projectName,
target: context.state.target,
target: context.state.target.id,
template: context.state.selectedTemplate,
});
},
Expand Down

0 comments on commit eea59a9

Please sign in to comment.