-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from semgrep/austin/saf-1199-vendor-pro-binar…
…y-with-vscode chore: vendor pro binary with vscode
- Loading branch information
Showing
18 changed files
with
460 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,61 @@ | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
preRelease: | ||
description: "Is this a pre-release?" | ||
type: boolean | ||
required: false | ||
default: false | ||
dryRun: | ||
description: "Is this a dry run?" | ||
type: boolean | ||
required: false | ||
default: false | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
name: Deploy Extension | ||
jobs: | ||
deploy: | ||
vscode-extension-publish: | ||
strategy: | ||
matrix: | ||
target: [linux-x64, linux-arm64, darwin-x64, darwin-arm64] | ||
name: Deploy Extension | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v1 | ||
- uses: actions/setup-node@v4.0.3 | ||
with: | ||
node-version: 16 | ||
node-version: lts/* | ||
- run: npm ci | ||
- uses: "aws-actions/[email protected]" | ||
with: | ||
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role" | ||
role-duration-seconds: 900, | ||
role-session-name: "semgrep-ide-integration-deploy" | ||
aws-region: "us-west-2" | ||
- name: download osemgrep pro | ||
run: ./download-osemgrep-pro.sh ${{ matrix.target }} | ||
- name: Publish to Open VSX Registry | ||
uses: HaaLeo/publish-vscode-extension@v1 | ||
uses: HaaLeo/publish-vscode-extension@v1.6.2 | ||
id: publishToOpenVSX | ||
with: | ||
# Tied to austin@, lives in 1password, does not expire | ||
pat: ${{ secrets.OPEN_VSX_TOKEN }} | ||
target: ${{ matrix.target }} # only for specific platforms | ||
# release pre-release if that's the event | ||
preRelease: ${{github.event.release.prerelease || inputs.preRelease}} | ||
dryRun: ${{ inputs.dryRun }} | ||
- name: Publish to Visual Studio Marketplace | ||
uses: HaaLeo/publish-vscode-extension@v1 | ||
uses: HaaLeo/publish-vscode-extension@v1.6.2 | ||
with: | ||
# Tied to bence@, lives in 1password expires in may 2024 | ||
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | ||
registryUrl: https://marketplace.visualstudio.com | ||
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} | ||
target: ${{ matrix.target }} | ||
# release pre-release if that's the event | ||
preRelease: ${{github.event.release.prerelease || inputs.preRelease}} | ||
dryRun: ${{ inputs.dryRun }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
- master | ||
paths-ignore: | ||
- "**.md" | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
vsce-test: | ||
|
@@ -25,11 +28,23 @@ jobs: | |
- name: Install Semgrep | ||
run: python -m pip install semgrep | ||
- name: Setup | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4.0.3 | ||
with: | ||
node-version: 16.x | ||
node-version: lts/* | ||
- name: install dependencies | ||
run: npm ci | ||
- uses: "aws-actions/[email protected]" | ||
with: | ||
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role" | ||
role-duration-seconds: 900, | ||
role-session-name: "semgrep-ide-integration-deploy" | ||
aws-region: "us-west-2" | ||
- if: matrix.os == 'macos-latest' | ||
name: download osemgrep pro | ||
run: ./download-osemgrep-pro.sh darwin-arm64 | ||
- if: matrix.os == 'ubuntu-latest' | ||
name: download osemgrep pro | ||
run: ./download-osemgrep-pro.sh linux-x64 | ||
- name: pretest | ||
run: npm run pretest | ||
- name: run native tests (Linux) | ||
|
@@ -39,7 +54,7 @@ jobs: | |
if: matrix.os == 'macos-latest' | ||
run: npm run test-native | ||
- name: uninstall semgrep | ||
run: python -m pip uninstall -y semgrep | ||
run: python -m pip uninstall -y semgrep && rm dist/osemgrep-pro | ||
- name: run js tests (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: xvfb-run -a npm run test-js | ||
|
@@ -58,9 +73,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4.0.3 | ||
with: | ||
node-version: 16.x | ||
node-version: lts/* | ||
- name: install dependencies | ||
run: npm ci | ||
# This is needed so download-lspjs.sh can run | ||
|
@@ -83,8 +98,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v1 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: lts/* | ||
- uses: "aws-actions/[email protected]" | ||
with: | ||
node-version: 16 | ||
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role" | ||
role-duration-seconds: 900, | ||
role-session-name: "semgrep-ide-integration-deploy" | ||
aws-region: "us-west-2" | ||
- name: download osemgrep pro | ||
run: ./download-osemgrep-pro.sh linux-x64 | ||
- run: npm ci | ||
- run: npm run vscode:prepublish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ node_modules | |
|
||
# Misc | ||
.DS_Store | ||
lspjs | ||
dist/* | ||
# From testing | ||
*_results.json | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"recommendations": ["Semgrep.semgrep", "Tobermory.es6-string-html"] | ||
"recommendations": [ | ||
"Semgrep.semgrep", | ||
"Tobermory.es6-string-html", | ||
"connor4312.esbuild-problem-matchers" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
# Check if lspjs exists and if its a symlink then exit | ||
if [ -L lspjs ]; then | ||
if [ -L dist/lspjs ]; then | ||
echo "lspjs symlink exists, not downloading as you are most likely using a local version" | ||
exit 0 | ||
fi | ||
mkdir -p lspjs/dist | ||
for var in "$@" | ||
mkdir -p dist/lspjs | ||
SEMGREP_VERSION=$(cat ./semgrep-version) | ||
echo "Downloading lspjs from S3 for version $SEMGREP_VERSION" | ||
for filename in Main.bc.js language-server-wasm.js semgrep-lsp-bindings.js semgrep-lsp.js | ||
do | ||
curl https://static.semgrep.dev/static/turbo/$(cat ./semgrep-version)/language_server/dist/$var -o ./lspjs/dist/$var | ||
echo "Downloading $filename" | ||
curl "https://static.semgrep.dev/static/turbo/$SEMGREP_VERSION/language_server/dist/$filename" -o "./dist/lspjs/$filename" | ||
done | ||
echo "Downloaded lspjs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
uname=$1 | ||
case "${uname}" in | ||
linux-x64*) machine=manylinux;; | ||
linux-arm64*) machine=linux-arm64;; | ||
darwin-x64*) machine=osx;; | ||
darwin-arm64) machine=osx-m1;; | ||
*) machine=manylinux;; | ||
esac | ||
# NOT the same as the semgrep version!!!! | ||
OSEMGREP_PRO_VERSION=$(cat ./osemgrep-pro-version) | ||
BINARY=semgrep-core-proprietary-${machine}-${OSEMGREP_PRO_VERSION} | ||
# Check if osemgrep-pro exists and if its a symlink then exit | ||
if [ -L dist/osemgrep-pro ]; then | ||
echo "osemgrep-pro symlink exists, not downloading as you are most likely using a local version" | ||
exit 0 | ||
fi | ||
mkdir -p dist | ||
echo "Downloading osemgrep-pro binary from S3 for version ${machine}-${OSEMGREP_PRO_VERSION}" | ||
aws s3 cp s3://deep-semgrep-artifacts/${BINARY} dist/osemgrep-pro | ||
echo "Downloaded osemgrep-pro binary" | ||
echo "Making osemgrep-pro binary executable" | ||
chmod +x dist/osemgrep-pro |
Oops, something went wrong.