Skip to content

Commit

Permalink
Build: Configure CI workflow for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaracha committed Sep 16, 2024
1 parent 0eea55a commit 2268bd1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Plugin Validation

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 22
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Validate Plugin
env:
GRADLE_PUBLISH_KEY: "${{ secrets.GRADLE_PUBLISH_KEY }}"
GRADLE_PUBLISH_SECRET: "${{ secrets.GRADLE_PUBLISH_SECRET }}"
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}"
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}"
run: ./gradlew publishPlugins --validate-only
7 changes: 7 additions & 0 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("jvm") version "2.0.20"
signing
id("com.gradle.plugin-publish") version "1.2.2"
}

Expand All @@ -28,6 +29,12 @@ gradlePlugin {
}
}

signing {
// Get credentials from env variables for better CI compatibility
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(22)
targetCompatibility = JavaVersion.VERSION_21
Expand Down

0 comments on commit 2268bd1

Please sign in to comment.