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
16 changes: 8 additions & 8 deletions .github/workflows/master-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Master CI v2

on:
push:
branches: [ master-2 ]
branches: [master-2]
pull_request:
branches: [ master-2 ]
branches: [master-2]

jobs:
build-scan:
Expand All @@ -30,12 +30,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-test:
name: Build & Test - JDK ${{ matrix.Java }} on ${{ matrix.os }}
name: Build & Test - JDK ${{ matrix.java }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java: [ '11', '17', '18', '21']
os: [ ubuntu-latest, windows-latest ]
java: ['11', '17', '21']
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

Expand All @@ -55,8 +55,8 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
key: ${{ runner.os }}-m2-${{ matrix.java }}
restore-keys: ${{ runner.os }}-m2-

- name: Build/Test
run: mvn -B clean package ${{ matrix.jdk }}
run: mvn -B clean package
62 changes: 0 additions & 62 deletions .github/workflows/master.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release CI v2

on:
release:
types: [created]

jobs:
build-test:
name: Build & Test - JDK ${{ matrix.java }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java: ['11', '17', '21']
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Show Versions
run: mvn -version

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ matrix.java }}
restore-keys: ${{ runner.os }}-m2-

- name: Build/Test
run: mvn -B clean package

publish:
name: Publish Release
needs: [build-test]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Apache Maven Central
run: mvn deploy -DskipTests -Psign
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
4 changes: 2 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
key: ${{ runner.os }}-m2-${{ matrix.java }}
restore-keys: ${{ runner.os }}-m2-

- name: Build/Test
run: mvn -B clean package
69 changes: 23 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>com.github.switcherapi</groupId>
<artifactId>switcher-client</artifactId>
<packaging>jar</packaging>
<version>2.2.3-SNAPSHOT</version>
<version>2.2.3</version>

<name>Switcher Client</name>
<description>Switcher Client SDK for working with Switcher API</description>
Expand Down Expand Up @@ -51,28 +51,27 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<argLine />

<!-- rest/json libs -->
<gson.version>2.12.1</gson.version>

<!-- utils -->
<gson.version>2.13.1</gson.version>
<commons-lang3.version>3.17.0</commons-lang3.version>
<commons-net.version>3.11.1</commons-net.version>
<slf4j-api.version>2.0.17</slf4j-api.version>

<!-- test -->
<okhttp.version>5.0.0-alpha.14</okhttp.version>
<junit.version>5.12.0</junit.version>
<okhttp.version>5.0.0-alpha.16</okhttp.version>
<junit-jupiter.version>5.13.0</junit-jupiter.version>
<junit-pioneer.version>2.3.0</junit-pioneer.version>
<junit-platform-launcher.version>1.13.0</junit-platform-launcher.version>

<!-- Plugins -->
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
<sonar-maven-plugin.version>3.11.0.3922</sonar-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>

<!-- Sonar -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
Expand Down Expand Up @@ -115,13 +114,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<version>${junit-jupiter.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>${junit-platform-launcher.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -150,34 +155,6 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.12.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

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

<profiles>
<profile>
<id>coverage</id>
Expand Down Expand Up @@ -325,15 +302,15 @@
</configuration>
</plugin>

<!-- Exclude log4j2 properties -->
<!-- Publish to Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<excludes>
<exclude>**/log4j2.properties</exclude>
</excludes>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public SwitcherResult submit() throws SwitcherException {
}
}

final SwitcherResult response = this.switcherExecutor.executeCriteria(this);
final SwitcherResult response = this.executeCriteria();
this.updateHistoryExecution(response);
return response;
}
Expand Down