From 13e79badf7fe97e7cf941bb03097cb9687e9c762 Mon Sep 17 00:00:00 2001 From: Aravindan M <83415736+aravindan888@users.noreply.github.com> Date: Sun, 28 Sep 2025 00:32:16 +0530 Subject: [PATCH 1/5] Update build.gradle --- build.gradle | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build.gradle b/build.gradle index e1b9c26..23e0d96 100644 --- a/build.gradle +++ b/build.gradle @@ -61,3 +61,25 @@ grailsPublish { desc = "Servlet filter that adds a X-FRAME-OPTIONS response header" developers = [mrhaki:"Hubert A. Klein Ikkink", sergio:"Sergio del Amo Caballero", sbglasius: "Søren Berg Glasius"] } +apply plugin: 'maven-publish' + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + groupId = project.group + artifactId = rootProject.name + version = project.version + } + } + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/${System.getenv("GITHUB_REPOSITORY")}") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} From 054cd35bfe96ac2bf49f488f95db15ba3e5fcdff Mon Sep 17 00:00:00 2001 From: Aravindan M <83415736+aravindan888@users.noreply.github.com> Date: Sun, 28 Sep 2025 00:34:23 +0530 Subject: [PATCH 2/5] Update build.gradle --- build.gradle | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 23e0d96..faee0e4 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ group "org.grails.plugins" apply plugin:"eclipse" apply plugin:"idea" apply plugin:"org.grails.grails-plugin" -apply plugin:"org.grails.grails-plugin-publish" +apply plugin: 'maven-publish' repositories { mavenLocal() @@ -44,25 +44,10 @@ dependencies { bootRun { jvmArgs('-Dspring.output.ansi.enabled=always') } -// enable if you wish to package this plugin as a standalone application + bootRepackage.enabled = false findMainClass.enabled = false -grailsPublish { - if (System.getenv('BINTRAY_USER') || project.hasProperty('bintrayUser')) { - user = System.getenv('BINTRAY_USER') ?: project.property('bintrayUser') - key = System.getenv('BINTRAY_KEY') ?: project.property('bintrayKey') - } - githubSlug = 'mrhaki/grails-x-frame-options-plugin' - license { - name = 'Apache-2.0' - } - title = "X-Frame-Options Plugin" - desc = "Servlet filter that adds a X-FRAME-OPTIONS response header" - developers = [mrhaki:"Hubert A. Klein Ikkink", sergio:"Sergio del Amo Caballero", sbglasius: "Søren Berg Glasius"] -} -apply plugin: 'maven-publish' - publishing { publications { mavenJava(MavenPublication) { From 9ac441bdab70ba52d26d8638b176c933ee1b04bf Mon Sep 17 00:00:00 2001 From: Aravindan M <83415736+aravindan888@users.noreply.github.com> Date: Sun, 28 Sep 2025 00:35:49 +0530 Subject: [PATCH 3/5] Create ci.yaml --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..47b1fa0 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [ master, main ] + tags: [ '*' ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + cache: gradle + + - name: Verify Gradle + run: ./gradlew --version + + - name: Build and Test + run: ./gradlew clean check assemble --stacktrace + + - name: Publish to GitHub Packages (on tag) + if: github.ref_type == 'tag' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./gradlew publish From 9c858774973770a58186e8a1256d692a919b1592 Mon Sep 17 00:00:00 2001 From: Aravindan M <83415736+aravindan888@users.noreply.github.com> Date: Sun, 28 Sep 2025 00:41:00 +0530 Subject: [PATCH 4/5] Update ci.yaml --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 47b1fa0..033f276 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,7 @@ on: branches: [ master, main ] tags: [ '*' ] pull_request: + workflow_dispatch: jobs: build: From b192ffe9aeb7d4ad887d587e40f55ea80f939f33 Mon Sep 17 00:00:00 2001 From: Aravindan M <83415736+aravindan888@users.noreply.github.com> Date: Sun, 28 Sep 2025 00:43:56 +0530 Subject: [PATCH 5/5] Update ci.yaml --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 033f276..0855c92 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,11 +15,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 8 uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 8 cache: gradle - name: Verify Gradle @@ -29,7 +29,7 @@ jobs: run: ./gradlew clean check assemble --stacktrace - name: Publish to GitHub Packages (on tag) - if: github.ref_type == 'tag' + if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./gradlew publish