Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@ jobs:
sudo rm -f /usr/bin/mvn # Remove existing symbolic link if it exists
sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn # Create new symbolic link

# - name: Setup java
# uses: actions/setup-java@v1
# with:
# java-version: ${{ matrix.java }}
- name: Setup java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
# cache: 'maven'

- name: Check Maven version
run: mvn -v

- name: Cache Maven packages
uses: actions/cache@v4
Expand All @@ -45,4 +54,4 @@ jobs:
node-version: 14.x

- name: Run the Maven verify phase
run: mvn verify -Dgpg.skip=true
run: mvn verify -Dgpg.skip=true --no-transfer-progress
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish to Maven Central

on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: false

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup JDK 7
uses: actions/setup-java@v4
with:
java-version: '7'
distribution: 'zulu'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.SIGNING_KEY }}
gpg-passphrase: SIGNING_PASSWORD

- name: Set version (if provided)
if: github.event.inputs.version != ''
run: |
mvn versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false

- name: Build and publish
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
mvn clean deploy -P publish \
--no-transfer-progress \
--batch-mode \
# -DskipTests \
# -Dgpg.keyname=${{ secrets.SIGNING_KEY_ID }} \
# -Dgpg.passphrase=${{ secrets.SIGNING_PASSWORD }} \
# -Dgpg.pinentry-mode=loopback \
70 changes: 56 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.socket</groupId>
<groupId>io.github.robinpcrd</groupId>
<artifactId>socket.io-client</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.0</version>
<packaging>jar</packaging>
<name>socket.io-client</name>
<description>Socket.IO Client Library for Java</description>
<url>https://github.com/socketio/socket.io-client-java</url>
<description>Socket.IO Client Library for Java (Fork)</description>
<url>https://github.com/RobinPcrd/socket.io-client-java</url>

<!--
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
-->

<properties>
<github.global.server>github</github.global.server>
Expand All @@ -27,9 +30,9 @@
</licenses>

<scm>
<url>https://github.com/socketio/socket.io-client-java</url>
<connection>scm:git:https://github.com/socketio/socket.io-client-java.git</connection>
<developerConnection>scm:git:https://github.com/socketio/socket.io-client-java.git</developerConnection>
<url>https://github.com/RobinPcrd/socket.io-client-java</url>
<connection>scm:git:https://github.com/RobinPcrd/socket.io-client-java.git</connection>
<developerConnection>scm:git:https://github.com/RobinPcrd/socket.io-client-java.git</developerConnection>
<tag>HEAD</tag>
</scm>

Expand All @@ -39,8 +42,14 @@
<name>Naoyuki Kanezawa</name>
<email>naoyuki.kanezawa@gmail.com</email>
</developer>
<developer>
<id>robinpcrd</id>
<name>Robin Picard</name>
<email>robin.picard.dev@gmail.com</email>
</developer>
</developers>

<!--
<repositories>
<repository>
<id>sonatype-oss-public</id>
Expand All @@ -53,9 +62,10 @@
</snapshots>
</repository>
</repositories>
-->

<prerequisites>
<maven>3.0.4</maven>
<maven>3.6.3</maven>
</prerequisites>

<dependencies>
Expand Down Expand Up @@ -89,16 +99,18 @@
</dependency>
</dependencies>

<!--
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>central</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>central</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
-->

<build>
<plugins>
Expand Down Expand Up @@ -129,6 +141,12 @@
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -167,17 +185,19 @@
<goals>deploy</goals>
</configuration>
</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>
<serverId>central</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down Expand Up @@ -249,4 +269,26 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>publish</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>uploaded</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>