diff --git a/.github/workflows/plugin.yml b/.github/workflows/plugin.yml new file mode 100644 index 0000000..319666a --- /dev/null +++ b/.github/workflows/plugin.yml @@ -0,0 +1,17 @@ +name: Plugin +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: build diff --git a/.github/workflows/portal.yml b/.github/workflows/portal.yml new file mode 100644 index 0000000..d3d4899 --- /dev/null +++ b/.github/workflows/portal.yml @@ -0,0 +1,20 @@ +name: Gradle Plugin Portal +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Publish with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: "publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PLUGIN_PUBLISHING_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PLUGIN_PUBLISHING_SECRET }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..df88231 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish +on: + push: + branches: + - master +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Publish with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: publishAllPublicationsToGitHubPackagesRepository publishAllPublicationsToGitLabRepository + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITLAB_TOKEN: "${{ secrets.GITLAB_TOKEN }}" diff --git a/.github/workflows/qodona.yml b/.github/workflows/qodona.yml new file mode 100644 index 0000000..3e71ba7 --- /dev/null +++ b/.github/workflows/qodona.yml @@ -0,0 +1,16 @@ +name: Qodona +on: [push] +jobs: + scan: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Qodana Scan + uses: JetBrains/qodana-action@main + env: + QODANA_TOKEN: "${{ secrets.QODANA_TOKEN }}" + - name: Upload CodeQL SARIF + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: "${{ runner.temp }}/qodana/results/qodana.sarif.json" diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml new file mode 100644 index 0000000..61e0e5b --- /dev/null +++ b/.github/workflows/samples.yml @@ -0,0 +1,25 @@ +name: Samples +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build mixed sample with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: -p samples/mixed build + - name: Build shared sample with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: -p samples/shared build + - name: Build simple sample with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: -p samples/simple build diff --git a/build.gradle.kts b/build.gradle.kts index f47af0c..cfc5190 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ plugins { `kotlin-dsl` kotlin("plugin.serialization") version "1.5.31" + `maven-publish` } group = "gay.pizza.foundation" @@ -37,3 +38,41 @@ gradlePlugin { } } } + +publishing { + repositories { + mavenLocal() + + var githubPackagesToken = System.getenv("GITHUB_TOKEN") + if (githubPackagesToken == null) { + githubPackagesToken = project.findProperty("github.token") as String? + } + + var gitlabPackagesToken = System.getenv("GITLAB_TOKEN") + if (gitlabPackagesToken == null) { + gitlabPackagesToken = project.findProperty("gitlab.com.accessToken") as String? + } + + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/gaypizzaspecifications/drywall") + credentials { + username = project.findProperty("github.username") as String? ?: "gaypizzaspecifications" + password = githubPackagesToken + } + } + + maven { + name = "GitLab" + url = uri("https://gitlab.com/api/v4/projects/47347654/packages/maven") + credentials(HttpHeaderCredentials::class.java) { + name = "Private-Token" + value = gitlabPackagesToken + } + + authentication { + create("header") + } + } + } +}