Skip to content

Commit

Permalink
adjust to CR
Browse files Browse the repository at this point in the history
  • Loading branch information
balins committed Feb 18, 2025
1 parent 7406fd9 commit 999ff18
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 33 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/lint-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: software-mansion-labs/vscode-js-debug
path: packages/vscode-js-debug
- name: Enforce HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "[email protected]:"

- name: Setup node
uses: actions/setup-node@v4
Expand All @@ -39,8 +37,16 @@ jobs:

- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npm i
run: npm ci

# - name: Lint extension
# working-directory: ${{ env.WORKING_DIRECTORY }}
# run: npm run lint

- name: Lint extension
- name: Test packaging
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npm run lint
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install -g @vscode/vsce
vsce package
7 changes: 7 additions & 0 deletions .github/workflows/publish-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
with:
ref: ${{ github.event.inputs.ref }}

- name: Enforce HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "[email protected]:"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -69,6 +72,8 @@ jobs:
- name: Build and publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
id: vs_marketplace_publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: ${{ steps.set_targets.outputs.targets }}
pat: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
Expand All @@ -77,6 +82,8 @@ jobs:

- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: ${{ steps.set_targets.outputs.targets }}
pat: ${{ secrets.OPENVSX_MARKETPLACE_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/typecheck-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Enforce HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "[email protected]:"

- name: Setup node
uses: actions/setup-node@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "packages/simulator-server"]
path = packages/simulator-server
url = https://github.com/software-mansion-labs/simulator-server.git
url = git@github.com:software-mansion-labs/simulator-server.git
[submodule "packages/vscode-js-debug"]
path = packages/vscode-js-debug
url = https://github.com/software-mansion-labs/vscode-js-debug.git
url = git@github.com:software-mansion-labs/vscode-js-debug.git
[submodule "packages/chrome-devtools-ui"]
path = packages/chrome-devtools-ui
url = https://github.com/software-mansion-labs/chrome-devtools-ui.git
url = git@github.com:software-mansion-labs/chrome-devtools-ui.git
[submodule "packages/redux-devtools-expo-dev-plugin"]
path = packages/redux-devtools-expo-dev-plugin
url = https://github.com/software-mansion-labs/redux-devtools-expo-dev-plugin.git
url = git@github.com:software-mansion-labs/redux-devtools-expo-dev-plugin.git
8 changes: 4 additions & 4 deletions packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,8 @@
"build:extension": "node ./scripts/buildExtensionCode.mjs production && npm run build:third-party",
"build:webview": "vite build --mode production && cp ./node_modules/@vscode/codicons/dist/codicon.* dist/.",
"build:sim-server-debug": "bash ./scripts/build-sim-server-debug.sh dist",
"build:sim-server": "bash ./scripts/download-sim-server-release-assets.sh dist",
"build:debug": "npm run build:extension-debug && npm run build:sim-server-debug",
"build:dist": "npm run prepare:submodules && npm run build:extension && npm run build:sim-server && npm run build:webview && npm run build:third-party-notice",
"build:dist": "npm run fetch:third-party && npm run fetch:sim-server-assets && npm run build:extension && npm run build:webview && npm run build:third-party-notice",
"build:third-party-notice": "node ./scripts/mergeThirdPartyNotices.mjs ./submodules-NOTICES.json ./dist/simulator-server-NOTICES.json ./dist/webview-NOTICES.json ./dist/extension-NOTICES.json ./ThirdPartyNotices.json",
"watch:extension": "vite",
"package": "rm -rf dist/ && npm run build:dist",
Expand All @@ -571,8 +570,9 @@
"build:tests": "tsc --project tsconfig.test.json",
"build:plugins": "bash ./scripts/install-dev-plugins.sh",
"test": "npm run build:extension && npm run build:webview && npm run build:tests && vscode-test",
"preinstall": "cd ../vscode-js-debug && git submodule update --init ./ && npm install && npm exec tsc",
"prepare:submodules": "git submodule update --init -- ../chrome-devtools-ui ../redux-devtools-expo-dev-plugin ../vscode-js-debug"
"preinstall": "bash ./scripts/init-submodules-if-not-present.sh ../vscode-js-debug && cd ../vscode-js-debug && npm i && npm exec tsc",
"fetch:sim-server-assets": "bash ./scripts/download-sim-server-release-assets.sh dist",
"fetch:third-party": "bash ./scripts/init-submodules-if-not-present.sh ../chrome-devtools-ui ../redux-devtools-expo-dev-plugin"
},
"devDependencies": {
"@babel/preset-react": "^7.23.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# This script downloads pre-built signed release versions of the simulator-server
# binaries and places them in the build location for packaging.
# along with third party licenses and places them in the build location for packaging.

set -e

Expand All @@ -11,30 +11,24 @@ cd "$(dirname "$0")/.."
# take output directory from first argument or default to out - relative to the vscode-extension package location
output_dir="${1:-out}"

# second argument is the tag of the simulator-server release to download, defaults to latest
sim_server_tag="${2:-latest}"
# second argument is the tag of the simulator-server release to download, set to latest if not provided
if [ -z "$2" ]; then
sim_server_tag=$(gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name' -R software-mansion-labs/simulator-server-releases)
echo "No tag provided, using latest release: $sim_server_tag"
else
sim_server_tag="$2"
fi

# Create the target directory if it doesn't exist
mkdir -p "$output_dir"

echo "Downloading simulator-server assets for tag $sim_server_tag"

# List release assets using GitHub API
release_info=$(curl -s "https://api.github.com/repos/software-mansion-labs/simulator-server-releases/releases/$sim_server_tag")

# Download simulator-server assets and place them in the output directory
echo "$release_info" |
grep "browser_download_url.*simulator-server" |
cut -d '"' -f 4 |
while read -r url; do
filename=$(basename "$url")
echo "Downloading $filename..."
curl -L "$url" -o "$output_dir/$filename"
done

# Make binaries executable
# Download simulator-server binaries using gh CLI and place them in the output directory with correct file mode
gh release download "$sim_server_tag" --clobber -R software-mansion-labs/simulator-server-releases -p "simulator-server*" -D "$output_dir"
chmod +x "$output_dir"/simulator-server*

mv "$output_dir"/THIRDPARTY.json "$output_dir"/simulator-server-NOTICES.json
# Download Third Party Notices file for simulator-server
gh release download "$sim_server_tag" --clobber -R software-mansion-labs/simulator-server-releases -p "THIRDPARTY.json" -O "$output_dir/simulator-server-NOTICES.json"

echo "Successfully downloaded simulator-server assets for tag $sim_server_tag"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Accepts multiple submodules, initializing them if they are empty.

for dir in "$@"; do
if [ -z "$(ls -A "$dir")" ]; then
echo "Submodule $(basename "$dir") is empty. Initializing..."
git submodule update --init "$dir"
else
echo "Submodule $(basename "$dir") is not empty. Skipping initialization."
fi
done

0 comments on commit 999ff18

Please sign in to comment.