Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make a release pipeline for maven central #178

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
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
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release Java SDK to Maven Central

on:
release:
types: [created]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'

- name: Extract release version
id: get_version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Set project version
run: mvn versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false

- name: Setup Maven settings
run: |
mkdir -p ~/.m2
echo '<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>ossrh</id>
<username>${{ secrets.MAVEN_USERNAME }}</username>
<password>${{ secrets.MAVEN_PASSWORD }}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
</mirrors>
<profiles>
</profiles>
</settings>
' > ~/.m2/settings.xml

- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
delete_private_key: true

- name: Deploy to Maven Central
run: mvn clean deploy -P release --settings ~/.m2/settings.xml
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4 changes: 2 additions & 2 deletions agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>integration</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
Expand Down
8 changes: 4 additions & 4 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -18,19 +18,19 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>models</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>common</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java -->
Expand Down
4 changes: 2 additions & 2 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 0 additions & 6 deletions common/src/main/java/io/keploy/utils/MagicBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
import java.util.Arrays;
import java.util.List;

/**
* Magic bytes can be checked at : https://en.wikipedia.org/wiki/List_of_file_signatures
* And converted to integer hex params using JS in the browser console, for example :
* "78 01 73 0D 62 ?? 60".split(" ").map(str => str == "??" ? "MagicBytes.ANY" : "0x"+str).join(", ")
* prints => "0x78, 0x01, 0x73, 0x0D, 0x62, MagicBytes.ANY, 0x60"
*/
public enum MagicBytes {
// Executables
EXE(Header.builder()
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>models</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 5 additions & 5 deletions integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -14,13 +14,13 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -36,13 +36,13 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>common</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>models</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
Expand Down
14 changes: 7 additions & 7 deletions keploy-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>

<artifactId>keploy-sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.4.5</version>
<name>keploy-sdk</name>
<!-- <description>keploy-sdk</description>-->
<description>Client Java SDK for Keploy</description>
Expand Down Expand Up @@ -47,31 +47,31 @@
<dependency>
<groupId>io.keploy</groupId>
<artifactId>core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>integration</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>models</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.keploy</groupId>
<artifactId>common</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-sdk</artifactId>
<groupId>io.keploy</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading
Loading