Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 45 additions & 56 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,34 @@ concurrency:

jobs:

# Prepare environment and build the plugin
# Prepare the environment and build the plugin
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

# Set up Java environment for the next steps
# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT

echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Build plugin
- name: Build plugin
run: ./gradlew buildPlugin
Expand All @@ -86,7 +69,7 @@ jobs:

echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT

# Store already-built plugin as an artifact for downloading
# Store an already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -100,25 +83,32 @@ jobs:
runs-on: ubuntu-latest
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

# Run tests
- name: Run Tests
env:
POWERMODE_ZERANTHIUM_TESTS: true
run: ./gradlew check

# Collect Tests Result of failed tests
Expand All @@ -131,11 +121,12 @@ jobs:

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ${{ github.workspace }}/build/reports/kover/report.xml
token: ${{ secrets.CODECOV_TOKEN }}

# Run Qodana inspections and provide report
# Run Qodana inspections and provide a report
inspectCode:
name: Inspect code
needs: [ build ]
Expand All @@ -148,25 +139,28 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis

# Set up Java environment for the next steps
# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2024.1.5
uses: JetBrains/qodana-action@v2025.1.1
with:
cache-default-branch-only: true

Expand All @@ -179,7 +173,7 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false
Expand All @@ -188,28 +182,22 @@ jobs:
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4


# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v4
with:
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
cache-read-only: true

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
run: ./gradlew verifyPlugin

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
Expand All @@ -220,7 +208,7 @@ jobs:
path: ${{ github.workspace }}/build/reports/pluginVerifier

# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered
# If accepted and published, the release workflow would be triggered
releaseDraft:
name: Release draft
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -248,10 +236,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ needs.build.outputs.version }}" \
VERSION=$(./gradlew properties --property version --quiet --console=plain | tail -n 1 | cut -f2- -d ' ')
RELEASE_NOTE="./build/tmp/release_note.txt"
./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE

gh release create $VERSION \
--draft \
--title "v${{ needs.build.outputs.version }}" \
--notes "$(cat << 'EOM'
${{ needs.build.outputs.changelog }}
EOM
)"
--title $VERSION \
--notes-file $RELEASE_NOTE
53 changes: 25 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
# Running the publishPlugin task requires all following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
# Running the publishPlugin task requires all the following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.

name: Release
Expand All @@ -18,57 +18,54 @@ jobs:
pull-requests: write
steps:

# Check out current repository
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Set up Java environment for the next steps
# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
cache-read-only: true

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d'
${{ github.event.release.body }}
EOM
)"

echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Update Unreleased section with the current release note
# Update the Unreleased section with the current release note
- name: Patch Changelog
if: ${{ steps.properties.outputs.changelog != '' }}
if: ${{ github.event.release.body != '' }}
env:
CHANGELOG: ${{ steps.properties.outputs.changelog }}
CHANGELOG: ${{ github.event.release.body }}
run: |
./gradlew patchChangelog --release-note="$CHANGELOG"
RELEASE_NOTE="./build/tmp/release_note.txt"
mkdir -p "$(dirname "$RELEASE_NOTE")"
echo "$CHANGELOG" > $RELEASE_NOTE

./gradlew patchChangelog --release-note-file=$RELEASE_NOTE

# Publish the plugin to JetBrains Marketplace
- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
# CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
# PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
# PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
run: ./gradlew publishPlugin

# Upload artifact as a release asset
# Upload an artifact as a release asset
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ jobs:

steps:

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
cache-read-only: true

# Run IDEA prepared for UI testing
- name: Run IDE
Expand Down
12 changes: 11 additions & 1 deletion README_dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
pluginUntilBuild = 241.*

- 1.1.3 update pluginVerifierIdeVersions
- 1.1.4 update plugin versions in `libs.versions.toml`
see https://github.com/JetBrains/intellij-platform-plugin-template/blob/main/gradle/libs.versions.toml


2. Update change notes plugin in build.gradle
Expand All @@ -27,10 +29,18 @@
export POWERMODE_ZERANTHIUM_TESTS="true"
./gradlew :test --info

6. publish
6. publish directly from cli (optional)
# ensure you have PUBLISH_TOKEN set as env var
./gradlew :publishPlugin --no-configuration-cache --info

7. push feature branch to github, will trigger build pipeline

8. merge feature branch, will trigger build pipeline on MAIN branch...
- by triggering on MAIN branch, will create an unpublished draft release object

9. publish release from github
- will trigger the 'release.yml' action, which will publish the plugin to the marketplace

```


Expand Down
Loading
Loading