From 423b3bd5b217db06b3da7b593f92b6cde6540e03 Mon Sep 17 00:00:00 2001 From: Julian Blazek Date: Fri, 21 Jun 2024 13:59:53 +0200 Subject: [PATCH] Update Build Action and Injection --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++++ .github/workflows/gradle.yml | 31 ------------------- build.gradle | 9 ++++-- gradle.properties | 5 +++ src/main/resources/META-INF/plugin.xml | 3 +- 5 files changed, 56 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d193cc8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [ main, ci-cd-improvements ] + pull_request: + + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + lfs: true + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: adopt-hotspot + - name: Set Variables + id: environment + shell: bash + run: | + LATEST_TAG = git describe --tags --abbrev=0 + echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT + - name: Build plugin + run: | + chmod +x gradlew + ./gradlew check buildPlugin + - name: Unpack unsigned plugin for repackaging + shell: bash + run: | + cd ${{ github.workspace }}/build/distributions + unzip *.zip -d pluginfiles + + - name: Upload built plugin + uses: actions/upload-artifact@v4 + with: + name: autoconfig-plugin-${{ steps.environment.outputs.latest_tag }} + path: build/distributions/pluginfiles/*/* + diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 796f65a..0000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI - -on: - push: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - lfs: true - - uses: actions/setup-java@v4 - name: Set up JDK 17 - with: - java-version: 17 - distribution: adopt-hotspot - - name: Build plugin - run: | - chmod +x gradlew - ./gradlew check buildPlugin signPlugin --info - env: - CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} - PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} - PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} - - name: Upload built plugin - uses: actions/upload-artifact@v4 - with: - name: autoconfig-plugin - path: build/distributions/*.zip diff --git a/build.gradle b/build.gradle index 164efd1..f93e5d7 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,9 @@ plugins { id "org.jsonschema2pojo" version "1.2.1" } +group = getProperty("pluginGroup") +version = getProperty("pluginVersion") + allprojects { group 'de.gebit.plugins.autoconfig' @@ -22,10 +25,12 @@ allprojects { } patchPluginXml { + version = getProperty("pluginVersion") sinceBuild = "232.1" untilBuild = "241.*" - pluginDescription = new File("metadata/description.html").text - changeNotes = new File("metadata/changelog.html").text + def bodyMatcher = /(?s)(?<=).*(?=<\/body>)/ + pluginDescription = new File("metadata/description.html").text.findAll(bodyMatcher)?[0] + changeNotes = new File("metadata/changelog.html").text.findAll(bodyMatcher)?[0] } signPlugin { diff --git a/gradle.properties b/gradle.properties index e5d9a95..2dc9d8d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,6 @@ +# Autoconfig Plugin Properties +pluginVersion = 0.0.2 +pluginGroup = de.gebit.plugins.autoconfig + +# IntelliJ Plugin Build Support kotlin.stdlib.default.dependency = false diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index ee9fd45..99b3ac0 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -2,8 +2,7 @@ de.gebit.plugins.autoconfig Autoconfig GEBIT Solutions GmbH - - 0.0.1 + com.intellij.modules.json