Skip to content

.github/workflows/publish.yaml #31

.github/workflows/publish.yaml

.github/workflows/publish.yaml #31

Workflow file for this run

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/[email protected]
with:
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
# 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)}"
- name: Publish to Open VSX Registry
uses: HaaLeo/[email protected]
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/[email protected]
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 }}