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
37 changes: 37 additions & 0 deletions .github/workflows/maven-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Maven build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 17, 18 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
cache: maven
- name: Build with Maven
run: mvn --batch-mode -DskipTests package --file pom.xml

- name: Test
run: mvn --batch-mode -Dmaven.test.failure.ignore=true test

# - name: Report
# uses: dorny/test-reporter@v1
# if: always()
# with:
# name: Maven Tests
# path: target/surefire-reports/*.xml
# reporter: java-junit
# fail-on-error: true
50 changes: 50 additions & 0 deletions .github/workflows/maven-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish package to the Maven Central Repository and GitHub Packages

on:
release:
types: [created]
jobs:

publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:

#To maven central
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 7
server-id: ossrh
#gpg is only needed for the first run
gpg-private-key: ${{ secrets.GPG_JAR_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Deploy to the Maven Central Repository
run: |
mvn -B -Dgpg.passphrase=${{ secrets.GPG_JAR_PASSWORD }} -P ossrh deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_JAR_PASSWORD }}

# To github packages!
- name: Set up Java for publishing to Github Packages
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 7
server-id: github

- name: Deploy to GitHub Packages
run: |
mvn -B -Dgpg.passphrase=${{ secrets.GPG_JAR_PASSWORD }} -P github deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_JAR_PASSWORD }}
175 changes: 68 additions & 107 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,121 +2,82 @@
<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>com.github.cmdotcom</groupId>
<artifactId>text-sdk-java</artifactId>
<version>1.3-SNAPSHOT</version>
<build>
<plugins>
<modelVersion>4.0.0</modelVersion>
<groupId>com.cm</groupId>
<artifactId>text-sdk-java</artifactId>
<version>2.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<version>3.10.1</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
<name>text-sdk-java</name>
<description>This is a library for sending messages with CM.com
</description>
<url>https://github.com/cmdotcom/text-sdk-java</url>

<name>Text-sdk-Java</name>
<description>This is a library for sending messages with CM.com
</description>
<url>https://github.com/cmdotcom/text-sdk-java</url>

<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<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>
<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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<profiles>
<profile>
<id>ossrh</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</distributionManagement>
</profile>
<profile>
<id>github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/cmdotcom/text-sdk-java</url>
</repository>
</distributionManagement>
</profile>
</profiles>

<scm>
<connection>scm:git:git://https://github.com/cmdotcom/text-sdk-java.git</connection>
<developerConnection>scm:git:ssh://https://github.com/cmdotcom/text-sdk-java.git</developerConnection>
<url>https://github.com/cmdotcom/text-sdk-java</url>
</scm>
<scm>
<connection>scm:git:git://https://github.com/cmdotcom/text-sdk-java.git</connection>
<developerConnection>scm:git:ssh://https://github.com/cmdotcom/text-sdk-java.git</developerConnection>
<url>https://github.com/cmdotcom/text-sdk-java</url>
</scm>

<developers>
<developer>
<name>Soufyan Bargach</name>
<email>Soufyan.Bargach@cmtelecom.com</email>
<organization>com.github.cmdotcom</organization>
<organizationUrl>http://cm.com/</organizationUrl>
</developer>
</developers>
<developers>
<developer>
<name>Soufyan Bargach</name>
<email>Soufyan.Bargach@cm.com</email>
<organization>com.github.cmdotcom</organization>
<organizationUrl>http://cm.com/</organizationUrl>
</developer>
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
</dependencies>
</project>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk;
package com.cm.text;

public class Config {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.cmtelecom.text.sdk;

import com.cmtelecom.text.sdk.models.Body;
import com.cmtelecom.text.sdk.models.Channel;
import com.cmtelecom.text.sdk.models.Message;
import com.cmtelecom.text.sdk.models.Recipient;
import com.cmtelecom.text.sdk.models.multichannel.IRichMessage;
import com.cmtelecom.text.sdk.models.multichannel.RichContent;
import com.cmtelecom.text.sdk.models.multichannel.Suggestion;
import com.cmtelecom.text.sdk.models.templates.TemplateMessage;
import com.cmtelecom.text.sdk.models.templates.TemplateMessageContent;
import com.cmtelecom.text.sdk.models.templates.WhatsAppTemplate;
package com.cm.text;


import com.cm.text.models.Body;
import com.cm.text.models.Channel;
import com.cm.text.models.Message;
import com.cm.text.models.Recipient;
import com.cm.text.models.multichannel.IRichMessage;
import com.cm.text.models.multichannel.RichContent;
import com.cm.text.models.multichannel.Suggestion;
import com.cm.text.models.templates.TemplateMessage;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.cmtelecom.text.sdk;
package com.cm.text;

import com.cm.text.models.Message;
import com.cm.text.models.Request;
import com.cm.text.models.Response;
import com.cm.text.utils.HttpHelper;
import com.google.gson.Gson;
import com.cmtelecom.text.sdk.models.Message;
import com.cmtelecom.text.sdk.models.Request;
import com.cmtelecom.text.sdk.models.Response;
import com.cmtelecom.text.sdk.utils.HttpHelper;

public class MessagingClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models;
package com.cm.text.models;

import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models;
package com.cm.text.models;

import com.google.gson.annotations.SerializedName;

Expand Down Expand Up @@ -106,4 +106,4 @@ public enum Channel {
/// Note that CM needs to configure this for you to work.
/// </remarks>
Instagram
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models;
package com.cm.text.models;

import com.google.gson.annotations.SerializedName;

Expand Down Expand Up @@ -113,7 +113,7 @@ public class Message {
public String Reference;

@SerializedName("richContent")
public com.cmtelecom.text.sdk.models.multichannel.RichContent RichContent;
public com.cm.text.models.multichannel.RichContent RichContent;

/// <summary>
/// Optional: For each message you send, you can set a validity.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models;
package com.cm.text.models;

import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models;
package com.cm.text.models;

import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models;
package com.cm.text.models;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models.multichannel;
package com.cm.text.models.multichannel;

import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models.multichannel;
package com.cm.text.models.multichannel;

public enum CarouselCardWidth {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.cmtelecom.text.sdk.models.multichannel;
package com.cm.text.models.multichannel;

import com.google.gson.annotations.SerializedName;

Expand Down
Loading