Skip to content

Commit

Permalink
Merge pull request #156 from sinch/release-1.3.0
Browse files Browse the repository at this point in the history
Merge release 'release-1.3.0' branch into main
  • Loading branch information
JPPortier authored Sep 30, 2024
2 parents 7300062 + b17e03a commit 476fffb
Show file tree
Hide file tree
Showing 1,202 changed files with 104,057 additions and 583 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Building Java SDK

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B -DskipITs clean package javadoc:javadoc --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

e2e-tests:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Checkout sinch-sdk-mockserver repository
uses: actions/checkout@v3
with:
repository: sinch/sinch-sdk-mockserver
token: ${{ secrets.MOCKSERVER_REPO_PAT_CI }}
fetch-depth: 0
path: sinch-sdk-mockserver

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start mock servers with Docker Compose
run: |
cd sinch-sdk-mockserver
docker-compose up -d
- name: Link to feature files
run: |
ln -s ${{ github.workspace }}/sinch-sdk-mockserver/features client/src/test/resources
- name: Run e2e tests
run: mvn -B -DskipUTs -Dspotless.check.skip=true verify --file pom.xml
23 changes: 0 additions & 23 deletions .github/workflows/maven.yml

This file was deleted.

38 changes: 31 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
releaseVersion:
description: "Version number to be released (use semver semantic: 'X.Y.Z')"
required: true
developmentVersion:
description: "Next development version to be set (use semver semantic: 'X.Y.Z', `-SNAPSHOT` suffix will be automatically added)"
nextDevelopmentVersion:
description: "Next development version to be set (use semver semantic: 'X.Y.Z', `-SNAPSHOT` artifact's suffix will be automatically added)"
required: true

permissions:
Expand Down Expand Up @@ -52,13 +52,36 @@ jobs:

- name: Create and switch to dedicated release branch
run: |
git checkout -b release-${{ github.event.inputs.releaseVersion }}
git checkout -b "release-${{ github.event.inputs.releaseVersion }}"
- name: Release
# e2e requirements
- name: Checkout sinch-sdk-mockserver repository
uses: actions/checkout@v3
with:
repository: sinch/sinch-sdk-mockserver
token: ${{ secrets.MOCKSERVER_REPO_PAT_CI }}
fetch-depth: 0
path: sinch-sdk-mockserver

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start mock servers with Docker Compose
run: |
mvn --batch-mode -s settings.xml release:clean release:prepare -Dtag=v${{ github.event.inputs.releaseVersion }} -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}-SNAPSHOT -DscmReleaseCommitComment="[release] Set release & tag: ${{ github.event.inputs.releaseVersion }}" -DscmDevelopmentCommitComment="[release] Set next version: ${{ github.event.inputs.developmentVersion }}-SNAPSHOT"
mvn --batch-mode -s settings.xml release:perform -Dusername=${{ env.GITHUB_USERNAME }} -Dpassword=${{ env.GITHUB_TOKEN }} -DskipTests=true
cd sinch-sdk-mockserver
docker-compose up -d
- name: Link to feature files
run: |
ln -s ${{ github.workspace }}/sinch-sdk-mockserver/features client/src/test/resources
- name: Release
run: scripts/release.sh
env:
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}
NEXT_VERSION: ${{ github.event.inputs.nextDevelopmentVersion }}
OSSRH_USER: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PWD: ${{ secrets.OSSRH_PWD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
Expand All @@ -68,6 +91,7 @@ jobs:


- name: Create dedicated release pull request
run: gh pr create -d -B main -H release-${{ github.event.inputs.releaseVersion }} --title "Merge release release-${{ github.event.inputs.releaseVersion }} branch into main" --body 'Created by Github action'
run: gh pr create -d -B main -H "release-${RELEASE_VERSION}" --title "Merge release '"release-${RELEASE_VERSION}"' branch into main" --body 'Created by Github action'
env:
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/samples-compilation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
cache: maven
- name: Building
run: |
mvn clean verify install -DskipTests=true -Dspotless.apply.skip=true
mvn clean install -DskipTests=true -Dspotless.apply.skip=true
cd sample-app
mvn -B clean package
mvn -B -f pom-webhooks.xml clean package
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ SinchClient client = new SinchClient(configuration);

Here is the list of the Sinch products and their level of support by the Java SDK:

| API Category | API Name | Status |
|------------------------|-----------------------------------|:------:|
| Messaging | SMS API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/sms/package-summary.html) ||
| Voice and Video | Voice API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/voice/package-summary.html) ||
| Numbers & Connectivity | Numbers API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/numbers/package-summary.html) ||
| Verification | Verification API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/verification/package-summary.html) ||
| API Category | API Name | Status |
|------------------------|-------------------------------------------------------------------------------------------------------------------------------------|:------:|
| Conversation | Conversation API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/conversation/package-summary.html) ||
| Messaging | SMS API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/sms/package-summary.html) ||
| Numbers & Connectivity | Numbers API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/numbers/package-summary.html) ||
| Verification | Verification API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/verification/package-summary.html) ||
| Voice and Video | Voice API [(javadoc)](https://developers.sinch.com/java-sdk/apidocs/com/sinch/sdk/domains/voice/package-summary.html) ||


## Logging
Expand Down
23 changes: 23 additions & 0 deletions client/resources/SDKTemplate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class VersionTemplating {

static final String SDK_FILE_PATH = "client/src/main/com/sinch/sdk/SDK.java";

public static void main(String[] args) throws IOException {

String versionValue = args[0];

Stream<String> lines = Files.lines(Paths.get(SDK_FILE_PATH));
String content = lines.collect(Collectors.joining("\n"));
lines.close();

System.out.println(
content.replaceAll("VERSION = \".*\"", String.format("VERSION = \"%s\"", versionValue)));
System.out.println("");
}
}
7 changes: 6 additions & 1 deletion client/resources/config-default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ voice-server-europe=https://calling-euc1.api.sinch.com
voice-server-north-america=https://calling-use1.api.sinch.com
voice-server-south-america=https://calling-sae1.api.sinch.com
voice-server-south-east-asia1=https://calling-apse1.api.sinch.com
voice-server-south-east-asia2=https://calling-apse2.api.sinch.com
voice-server-south-east-asia2=https://calling-apse2.api.sinch.com

conversation-region=us
conversation-server=https://%s.conversation.api.sinch.com
template-management-conversation-server=https://%s.template.api.sinch.com

3 changes: 0 additions & 3 deletions client/resources/version.properties

This file was deleted.

8 changes: 8 additions & 0 deletions client/src/main/com/sinch/sdk/SDK.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.sinch.sdk;

public class SDK {

public static final String NAME = "Sinch Java SDK";
public static final String VERSION = "1.4.0-dev";
public static final String AUXILIARY_FLAG = "";
}
Loading

0 comments on commit 476fffb

Please sign in to comment.