.github/workflows/publish.yaml #18
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] | |
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 | |
run: ./download-osemgrep-pro.sh ${{ matrix.target }} | |
- name: Publish to Open VSX Registry | |
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.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 }} |