Upgrade to Intellij platform gradle plugin 2.0 #64
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
# GitHub Action Workflow for building a pull request commit and validating that the commit builds for all | |
# release versions of the plugin. | |
# | |
# Workflow is triggered on pull requests to the repo. | |
# | |
# Additional Docs: | |
# - GitHub Actions: https://help.github.com/en/actions | |
name: build-pr | |
on: | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
jobs: | |
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum | |
gradleValidation: | |
name: Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
# Check out current repository | |
- name: Fetch sources | |
uses: actions/checkout@v2 | |
# Validate wrapper | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
# Build and test plugin and provide artifact. | |
build: | |
name: Build | |
needs: gradleValidation | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
product: [ "IC-2023.1", "IC-2023.2", "IC-2023.3", "IC-2024.1" ] | |
max-parallel: 5 | |
env: | |
PRODUCT_NAME: ${{ matrix.product }} | |
outputs: | |
name: ${{ steps.properties.outputs.name }} | |
version: ${{ steps.properties.outputs.version }} | |
artifact: ${{ steps.properties.outputs.artifact }} | |
steps: | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v2 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
# Cache Gradle dependencies | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} | |
# Cache Gradle Wrapper | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# 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 ' ')" | |
NAME="$(echo "$PROPERTIES" | grep "^pluginName_:" | cut -f2- -d ' ')" | |
ARTIFACT="${NAME}-${VERSION}.zip" | |
echo "::set-output name=version::$VERSION" | |
echo "::set-output name=name::$NAME" | |
echo "::set-output name=artifact::$ARTIFACT" | |
# Build artifact using build Gradle task | |
- name: Build | |
run: ./gradlew build | |
# Build artifact using buildPlugin Gradle task | |
- name: Build Plugin | |
run: ./gradlew buildPlugin | |
# Run intellij:verifyPlugin task. | |
- name: Verify Plugin | |
run: ./gradlew verifyPlugin | |
# Upload plugin artifact to make it available in the next jobs | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.product }}-plugin-artifact | |
path: ./build/distributions/${{ needs.build.outputs.artifact }} |