Workflow file for this run
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
on: | |
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 | |
jobs: | |
vscode-extension-publish: | |
strategy: | |
matrix: | |
target: | |
[ | |
linux-x64, | |
linux-arm64, | |
darwin-x64, | |
darwin-arm64, | |
win32-x64, | |
win32-arm64, | |
] | |
name: Deploy Extension | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4.0.3 | |
with: | |
node-version: lts/* | |
- run: npm ci | |
- uses: "aws-actions/configure-aws-credentials@v4.0.2" | |
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 | |
# skip if windows | |
if: matrix.target != 'win32-x64' && matrix.target != 'win32-arm64' | |
run: ./download-osemgrep-pro.sh ${{ matrix.target }} | |
- name: install vsix | |
run: npm install -g @vscode/vsce | |
- name: Package with vsce | |
run: vsce package --target ${{ matrix.target }} | |
- name: Find the vsix | |
id: vsixPathStep | |
run: echo "vsixPath=$(find . -name '*.vsix' -print -quit)" >> "$GITHUB_OUTPUT" | |
- name: Publish to Open VSX Registry | |
uses: HaaLeo/publish-vscode-extension@v1.6.2 | |
id: publishToOpenVSX | |
# Try publishing to Open VSX, but don't fail if it fails | |
# that way we can still publish to the marketplace | |
continue-on-error: true | |
with: | |
# Tied to austin@, lives in 1password, does not expire | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
extensionFile: ${{ steps.vsixPathStep.outputs.vsixPath }} | |
# 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.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.vsixPathStep.outputs.vsixPath }} | |
# release pre-release if that's the event | |
preRelease: ${{github.event.release.prerelease || inputs.preRelease}} | |
dryRun: ${{ inputs.dryRun }} |