From 9aee5df18252fc2d7207d9a7b138b63fe172349b Mon Sep 17 00:00:00 2001 From: SkytAsul Date: Thu, 27 Jun 2024 09:24:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Added=20CI,=20changed=20groupId?= =?UTF-8?q?=20to=20fr.skytasul?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maven-build.yml | 31 ++++++++++++++++++++++++++++ .github/workflows/maven-publish.yml | 32 +++++++++++++++++++++++++++++ pom.xml | 31 ++++++++++++++-------------- 3 files changed, 79 insertions(+), 15 deletions(-) create mode 100755 .github/workflows/maven-build.yml create mode 100755 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml new file mode 100755 index 0000000..c61c938 --- /dev/null +++ b/.github/workflows/maven-build.yml @@ -0,0 +1,31 @@ +name: Maven Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - uses: s4u/maven-settings-action@v3.0.0 + with: + servers: '[{"id": "central", "username": "${{ secrets.CENTRAL_USERNAME }}", "password": "${{ secrets.CENTRAL_PASSWORD }}"}]' + + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100755 index 0000000..e441a07 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,32 @@ +name: Maven Publish + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - uses: s4u/maven-settings-action@v3.0.0 + with: + servers: '[{"id": "central", "username": "${{ secrets.CENTRAL_USERNAME }}", "password": "${{ secrets.CENTRAL_PASSWORD }}"}]' + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to Maven Central + run: mvn deploy diff --git a/pom.xml b/pom.xml index 69db1ee..c30d2d9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.github.skytasul + fr.skytasul glowingentities 1.3.5 @@ -28,7 +28,8 @@ scm:git:git://github.com/SkytAsul/GlowingEntities.git - scm:git:ssh://github.com:SkytAsul/GlowingEntities.git + + scm:git:ssh://github.com:SkytAsul/GlowingEntities.git http://github.com/SkytAsul/GlowingEntities/tree/master @@ -59,13 +60,13 @@ 4.1.68.Final provided - - - org.jetbrains - annotations - 24.0.0 - provided - + + + org.jetbrains + annotations + 24.0.0 + provided + @@ -111,14 +112,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.12 + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 true - ossrh - https://s01.oss.sonatype.org/ - false + central + true + published