Skip to content

fix: add CodeQL workflow and restrict workflow permissions #215

fix: add CodeQL workflow and restrict workflow permissions

fix: add CodeQL workflow and restrict workflow permissions #215

Workflow file for this run

name: Build & Publish
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
cache: true
cache-dependency-path: src/dotnet/*/*.csproj
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0b6dd653ba04f4f93bf581ec31e66cbd7dcb644d # v4
- name: Cache IntelliJ Platform
uses: actions/cache@v4
with:
path: .intellijPlatform
key: intellij-${{ hashFiles('gradle.properties') }}
- name: Build Plugin
if: github.ref != 'refs/heads/master'
run: ./gradlew buildPlugin --parallel --build-cache
- name: Build & Publish Plugin
if: github.ref == 'refs/heads/master'
shell: bash
run: ./gradlew publishPlugin -PBuildConfiguration="Release" -PPublishToken="$PUBLISH_KEY" --parallel --build-cache
env:
PUBLISH_KEY: ${{ secrets.PublishKey }}
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: output
retention-days: 7