Skip to content

Commit

Permalink
Merge pull request #24 from Lycoon/dev
Browse files Browse the repository at this point in the history
Deploy version 3.0.2 on Maven Central
  • Loading branch information
Lycoon authored Nov 15, 2023
2 parents 6f9c198 + bb81eb5 commit 26360ec
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 34 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/deploy-ci.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to Maven Central

on:
push:
branches:
- release

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish package
run: mvn -Psign -DskipTests --batch-mode deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5 changes: 2 additions & 3 deletions .github/workflows/check-ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check CI
name: Check build

on:
push:
Expand All @@ -8,7 +8,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
Expand All @@ -21,5 +20,5 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build with Maven
- name: Build
run: mvn --batch-mode --update-snapshots -DskipTests verify
120 changes: 115 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,49 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<groupId>com.lycoon</groupId>
<artifactId>clashapi</artifactId>
<groupId>io.github.lycoon</groupId>
<artifactId>clash-api</artifactId>
<version>3.0.2</version>

<!-- Project metadata -->
<name>${project.groupId}:${project.artifactId}</name>
<description>Kotlin wrapper for Clash of Clans game API.</description>
<url>https://github.com/Lycoon/clash-api</url>

<licenses>
<license>
<name>GPL-3.0 License</name>
<url>https://github.com/Lycoon/clash-api/blob/dev/LICENSE</url>
</license>
</licenses>

<developers>
<developer>
<name>Hugo "Lycoon" Bois</name>
<email>hugo.bois@hotmail.fr</email>
<organizationUrl>https://github.com/Lycoon</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/lycoon/clash-api.git</connection>
<developerConnection>scm:git:ssh://github.com:lycoon/clash-api.git</developerConnection>
<url>https://github.com/Lycoon/clash-api/tree/release</url>
</scm>

<!-- Distribution Management -->
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>ClashAPI</name>
<url>https://maven.pkg.github.com/Lycoon/clash-api</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<!-- Dependencies -->
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
Expand All @@ -41,8 +72,53 @@
</dependency>
</dependencies>


<build>
<plugins>
<!-- Maven Source plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Maven Javadoc plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Sonatype Nexus Staging plugin -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

<!-- Maven Kotlin plugin -->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
Expand Down Expand Up @@ -75,6 +151,7 @@
</plugins>
</build>

<!-- Properties -->
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -84,4 +161,37 @@
<serialization.version>1.3.1</serialization.version>
<java.version>1.8</java.version>
</properties>

<!-- Profiles -->
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<!-- GPG Signing plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 26360ec

Please sign in to comment.