Skip to content

Publish to JetBrains Marketplace #10

Publish to JetBrains Marketplace

Publish to JetBrains Marketplace #10

name: Publish to JetBrains Marketplace
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
release_tag:
description: 'Use release notes of'
type: string
required: true
jobs:
publish:
name: Publish release
runs-on: ubuntu-latest
steps:
# Setup environment
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt
# Setup cache
- name: Setup cache for Gradle and dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: "gradle-\
${{runner.os}}-\
${{hashFiles('gradle/wrapper/gradle-wrapper.properties')}}-\
${{hashFiles('gradle.properties', '**/*.gradle.kts')}}"
# Build and publish
- name: Obtain release notes
uses: actions/github-script@v6
with:
script: |
await require('.github/scripts/get-release-notes.js')({
github, context, core,
outputFile: 'release_note.md',
releaseTagInput: 'release_tag',
allowFallbackToLatest: true,
});
- name: Patch changelog for release
run: ./gradlew --stacktrace patchChangelog --release-note="$(<release_note.md)"
- name: Build and publish plugin
id: gradle-build
env:
JETBRAINS_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
run: ./gradlew --stacktrace publishPlugin
# Upload artifacts
- name: Upload build reports
if: steps.gradle-build.outcome == 'success' || steps.gradle-build.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: build-reports
path: build/reports/
if-no-files-found: ignore