Skip to content

Commit

Permalink
Migrate to IntelliJ Gradle Plugin 2.0 (#100)
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Zatsarynnyi <[email protected]>
  • Loading branch information
azatsarynnyy authored Jan 28, 2025
1 parent 496762e commit 242a947
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 174 deletions.
44 changes: 18 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
# Trigger the workflow on any pull request
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

# Prepare environment and build the plugin
Expand All @@ -32,13 +36,13 @@ jobs:
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:

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

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

# Set up Java environment for the next steps
- name: Setup Java
Expand All @@ -49,9 +53,7 @@ jobs:

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

# Set environment variables
- name: Export Properties
Expand All @@ -69,8 +71,6 @@ jobs:
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Build plugin
- name: Build plugin
run: ./gradlew buildPlugin
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
runs-on: ubuntu-latest
steps:

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

Expand All @@ -113,9 +113,7 @@ jobs:

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

# Run tests
- name: Run Tests
Expand Down Expand Up @@ -153,9 +151,12 @@ jobs:
tool-cache: false
large-packages: false

# Check out current repository
# 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
- name: Setup Java
Expand All @@ -166,7 +167,7 @@ jobs:

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/[email protected].3
uses: JetBrains/[email protected]
with:
cache-default-branch-only: true

Expand All @@ -184,7 +185,7 @@ jobs:
tool-cache: false
large-packages: false

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

Expand All @@ -197,9 +198,7 @@ jobs:

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

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
Expand Down Expand Up @@ -231,17 +230,10 @@ jobs:
contents: write
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
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Remove old release drafts by using the curl request for the available releases with a draft flag
- name: Remove Old Release Drafts
env:
Expand All @@ -256,7 +248,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ needs.build.outputs.version }} \
gh release create "v${{ needs.build.outputs.version }}" \
--draft \
--title "v${{ needs.build.outputs.version }}" \
--notes "$(cat << 'EOM'
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pull-requests: write
steps:

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
Expand All @@ -33,9 +33,7 @@ jobs:

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

# Set environment variables
- name: Export Properties
Expand All @@ -51,7 +49,7 @@ jobs:
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 != '' }}
env:
Expand All @@ -61,7 +59,6 @@ jobs:
# Publish the plugin to JetBrains Marketplace
# - name: Publish Plugin
# continue-on-error: true # Artem: skip for testing
# env:
# PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
# CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:

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

Expand All @@ -44,9 +44,7 @@ jobs:

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

# Run IDEA prepared for UI testing
- name: Run IDE
Expand Down
Loading

0 comments on commit 242a947

Please sign in to comment.