From 64a68ea1c93293e361454b3371d8747942d7abd8 Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:29:10 +0100 Subject: [PATCH] Fix publish workflow for macOS Signed-off-by: paulober <44974737+paulober@users.noreply.github.com> --- .vscodeignore | 8 ++++++-- package.json | 4 ++-- scripts/publish.sh | 20 +++++++++++++------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.vscodeignore b/.vscodeignore index 0c52a59..6c627fb 100755 --- a/.vscodeignore +++ b/.vscodeignore @@ -7,10 +7,10 @@ node_modules/** src/** .gitignore .yarnrc -rollup.config.mjs +*rollup.config.mjs **/tsconfig.json **/eslint.config.mjs -**/*.map +vscodeUninstall.mjs **/*.ts .github/** @@ -29,3 +29,7 @@ azure-pipelines.yml !dist/*.cjs !mpy_stubs/ !web/ +!LICENSE.txt +!README.md +!CHANGELOG.md + diff --git a/package.json b/package.json index 0c669ad..2fd3f32 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,8 @@ } }, "extensionDependencies": [ - "ms-python.python" - ], + "ms-python.python" + ], "activationEvents": [ "workspaceContains:.picowgo", "workspaceContains:.micropico", diff --git a/scripts/publish.sh b/scripts/publish.sh index 29edaf0..32e6b8c 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -15,18 +15,24 @@ chmod +x "$SCRIPT_DIR/package.sh" # Find all .vsix files except the one without a platform prefix and publish them one by one find . -type f -name "micropico-$RELEASE_TAG_NAME-*.vsix" ! -name "micropico-$RELEASE_TAG_NAME.vsix" | while read -r package_path; do - # Default target flags (for non-darwin platforms) - target_flags="" - - # If the filename contains "darwin", add the appropriate target flags + # If the filename contains "darwin", skip as macOS universal publishing issn't possible at the moment if [[ "$package_path" == *"darwin"* ]]; then - target_flags="--target darwin-x64 darwin-arm64 " + continue fi # Publish the VSCode extension to the VSCode Marketplace - npx @vscode/vsce publish $target_flags--packagePath "$package_path" + npx @vscode/vsce publish --packagePath "$package_path" # Publish the VSCode extension to the Open VSX Registry - npx ovsx publish "$package_path" $target_flags-p "$OVSX_PAT" + npx ovsx publish "$package_path" -p "$OVSX_PAT" # delete this vsix file rm -rf "$package_path" done + +# macOS universal publish not possible workaround + +rm *.vsix +rm -rf prebuilds +mkdir prebuilds +cp -r "node_modules/@serialport/bindings-cpp/prebuilds/darwin-x64+arm64" "./prebuilds" +npx @vscode/vsce publish --no-yarn --target darwin-x64 darwin-arm64 +npx ovsx publish --target darwin-x64 darwin-arm64 -p "$OVSX_PAT"