This commit is contained in:
Anas Elgarhy 2022-11-03 01:31:17 +02:00
parent 7cb5863039
commit 9bc53afd72
6 changed files with 288 additions and 10 deletions

14
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,14 @@
# Dependabot configuration:
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

173
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,173 @@
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
# - validate Gradle Wrapper,
# - run test and verifyPlugin tasks,
# - run buildPlugin task and prepare artifact for the further tests,
# - run IntelliJ Plugin Verifier,
# - create a draft release.
#
# Workflow is triggered on push and pull_request events.
#
# Docs:
# - GitHub Actions: https://help.github.com/en/actions
# - IntelliJ Plugin Verifier GitHub Action: https://github.com/ChrisCarini/intellij-platform-plugin-verifier-action
#
name: Build
on:
pull_request:
branches:
- master
jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v2
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.3
# Run verifyPlugin and test Gradle tasks
test:
name: Test
needs: gradleValidation
runs-on: ubuntu-latest
steps:
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
- name: Fetch Sources
uses: actions/checkout@v2
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Run Linters and Test
run: ./gradlew check
- name: Verify Plugin
run: ./gradlew verifyPlugin
# Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
# Requires test job to be passed
build:
name: Build
needs: test
runs-on: ubuntu-latest
outputs:
name: ${{ steps.properties.outputs.name }}
version: ${{ steps.properties.outputs.version }}
artifact: ${{ steps.properties.outputs.artifact }}
steps:
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
- name: Fetch Sources
uses: actions/checkout@v2
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Set environment variables
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"
- name: Build Plugin
run: ./gradlew buildPlugin
# Upload plugin artifact to make it available in the next jobs
- name: Upload artifact
uses: actions/upload-artifact@v2.2.3
with:
name: plugin-artifact
path: ./build/distributions/${{ needs.build.outputs.artifact }}
# Verify built plugin using IntelliJ Plugin Verifier tool
# Requires build job to be passed
verify:
name: Verify
needs: build
runs-on: ubuntu-latest
steps:
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
- name: Fetch Sources
uses: actions/checkout@v2
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2.1.4
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)"
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
echo "::set-output name=ideVersions::$IDE_VERSIONS"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v2.1.4
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
# Run IntelliJ Plugin Verifier action using GitHub Action
- name: Verify Plugin
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}

85
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,85 @@
# GitHub Actions Workflow created for handling the release process based on the draft release prepared
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
name: Release
on:
release:
types: [released]
jobs:
# Prepare and publish the plugin to the Marketplace repository
# release:
# name: Publish Plugin
# runs-on: ubuntu-latest
# steps:
#
# - name: Setup Java
# uses: actions/setup-java@v2
# with:
# java-version: 11
# distribution: 'zulu'
#
# - name: Fetch Sources
# uses: actions/checkout@v2
# with:
# ref: ${{ github.event.release.tag_name }}
#
# - name: Publish Plugin
# env:
# PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
# run: ./gradlew publishPlugin
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
- name: Fetch Sources
uses: actions/checkout@v2
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2.1.4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Set environment variables
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"
- name: Build Plugin
run: ./gradlew buildPlugin
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/distributions/${{ steps.properties.outputs.artifact }}
asset_name: ${{ steps.properties.outputs.artifact }}
asset_content_type: application/zip

View file

@ -4,7 +4,7 @@
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="17" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ProjectType">

View file

@ -1,10 +1,10 @@
plugins {
id("java")
id("org.jetbrains.intellij") version "1.9.0"
id("org.jetbrains.intellij") version "1.10.0-SNAPSHOT"
}
group = "com.anas.intellij.plugins.ayah"
version = "0.0.8"
version = "0.0.9"
repositories {
mavenCentral()
@ -24,14 +24,14 @@ dependencies {
testAnnotationProcessor("org.projectlombok:lombok:1.18.24")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2022.2.1")
version.set("LATEST-EAP-SNAPSHOT")
type.set("IC") // Target IDE Platform
downloadSources.set(true)
@ -42,12 +42,12 @@ tasks {
// Set the JVM compatibility versions
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = "11"
targetCompatibility = "11"
sourceCompatibility = "17"
targetCompatibility = "17"
}
patchPluginXml {
sinceBuild.set("213")
sinceBuild.set("223")
untilBuild.set("223.*")
}

View file

@ -1 +1,7 @@
rootProject.name = "Ayah-intellij"
rootProject.name = "Ayah-intellij"
pluginManagement {
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
gradlePluginPortal()
}
}