From 5ce6d99eda93c7b1b68b4582bb4985fb5e5d1ec8 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:25:28 +0200 Subject: [PATCH 01/23] fix: publish package workflow for github action --- .github/workflows/publish-package.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 52bcc73..b8daa85 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,9 +1,9 @@ name: Publish package -on: - workflow_run: - workflows: ["Create Release"] - types: [completed] +on: [push] + #workflow_run: + # workflows: ["Create Release"] + # types: [completed] jobs: publish: @@ -12,7 +12,8 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v3 + - name: Pull the code from the repository + uses: actions/checkout@v3 - name: Set up Java for publishing to Maven Central Repository uses: actions/setup-java@v3 with: @@ -22,7 +23,9 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Install GPG key - run: cat ${{ secrets.OSSRH_GPG_SECRET_KEY }} | base64 -d | gpg --batch --import + run: | + sudo apt-get install gnupg + cat ${{ secrets.OSSRH_GPG_SECRET_KEY }} | base64 -d | gpg --batch --import - name: Publish to the Maven Central Repository run: mvn --batch-mode \ clean deploy \ From 8bd81d8a97ca99ebf2b983aa3a1183be52448920 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:28:49 +0200 Subject: [PATCH 02/23] fix: publish package workflow for github action --- .github/workflows/publish-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index b8daa85..cad4018 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -24,8 +24,10 @@ jobs: server-password: MAVEN_PASSWORD - name: Install GPG key run: | + echo "Installing GNUPG..." sudo apt-get install gnupg - cat ${{ secrets.OSSRH_GPG_SECRET_KEY }} | base64 -d | gpg --batch --import + echo "Importing GPG key..." + echo ${{ secrets.OSSRH_GPG_SECRET_KEY }} | base64 -d | gpg --batch --import - name: Publish to the Maven Central Repository run: mvn --batch-mode \ clean deploy \ From 179dc0f61e89ceda2f4b59cc60c1c5e13c38bb5c Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:30:25 +0200 Subject: [PATCH 03/23] fix: publish package for github action gpg key installation --- .github/workflows/publish-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index cad4018..83684e9 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -27,7 +27,7 @@ jobs: echo "Installing GNUPG..." sudo apt-get install gnupg echo "Importing GPG key..." - echo ${{ secrets.OSSRH_GPG_SECRET_KEY }} | base64 -d | gpg --batch --import + echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 -d | gpg --batch --import - name: Publish to the Maven Central Repository run: mvn --batch-mode \ clean deploy \ From 4cfb803342faaaf880231e4b0c303efb75165e1f Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:31:51 +0200 Subject: [PATCH 04/23] fix: publish package for github action gpg key installation --- .github/workflows/publish-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 83684e9..dff8bab 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -28,6 +28,7 @@ jobs: sudo apt-get install gnupg echo "Importing GPG key..." echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 -d | gpg --batch --import + echo "GPG key imported." - name: Publish to the Maven Central Repository run: mvn --batch-mode \ clean deploy \ From 71099173a27bb5bc6562e6a832e47df0d90a805c Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:32:58 +0200 Subject: [PATCH 05/23] fix: publish package for github action gpg key installation --- .github/workflows/publish-package.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index dff8bab..d48fa6a 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -12,6 +12,13 @@ jobs: contents: read packages: write steps: + - name: Install GPG key + run: | + echo "Installing GNUPG..." + sudo apt-get install gnupg + echo "Importing GPG key..." + echo -n "${{ secrets.OSSRH_GPG_PRIVATE_KEY }}" | base64 -d | gpg --batch --import + echo "GPG key imported." - name: Pull the code from the repository uses: actions/checkout@v3 - name: Set up Java for publishing to Maven Central Repository @@ -22,13 +29,6 @@ jobs: server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - - name: Install GPG key - run: | - echo "Installing GNUPG..." - sudo apt-get install gnupg - echo "Importing GPG key..." - echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 -d | gpg --batch --import - echo "GPG key imported." - name: Publish to the Maven Central Repository run: mvn --batch-mode \ clean deploy \ From b3bb0e8cd76b6ab6cee000b0bc09dd2bf65128a4 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:51:22 +0200 Subject: [PATCH 06/23] Update publish-package.yml --- .github/workflows/publish-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index d48fa6a..305c6f3 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -31,7 +31,7 @@ jobs: server-password: MAVEN_PASSWORD - name: Publish to the Maven Central Repository run: mvn --batch-mode \ - clean deploy \ + deploy \ -Dmaven.test.skip=true \ -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} env: @@ -44,7 +44,7 @@ jobs: distribution: 'temurin' - name: Publish to GitHub Packages run: mvn --batch-mode \ - clean deploy \ + deploy \ -Dmaven.test.skip=true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 155646da7ad27dea6cde02ead6cdf3016f24bc00 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:52:46 +0200 Subject: [PATCH 07/23] Update publish-package.yml --- .github/workflows/publish-package.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 305c6f3..9e3d40c 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -30,10 +30,7 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Publish to the Maven Central Repository - run: mvn --batch-mode \ - deploy \ - -Dmaven.test.skip=true \ - -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} + run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} @@ -43,8 +40,6 @@ jobs: java-version: '17' distribution: 'temurin' - name: Publish to GitHub Packages - run: mvn --batch-mode \ - deploy \ - -Dmaven.test.skip=true + run: mvn --batch-mode deploy -Dmaven.test.skip=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 70f81e687bfcf468c2e0520fae59a1dcc9b472f4 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:18:06 +0200 Subject: [PATCH 08/23] add: keystore registration in publish package workflow --- .github/workflows/publish-package.yml | 2 ++ .gitignore | 3 +++ Makefile | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 9e3d40c..2533312 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -29,6 +29,8 @@ jobs: server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD + - name: Register key to Ubuntu Keyserver + run: gpg --keyserver keyserver.ubuntu.com --send-keys ${{ secrets.OSSRH_GPG_KEY_ID }} - name: Publish to the Maven Central Repository run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} env: diff --git a/.gitignore b/.gitignore index 3bc1aed..3e4938c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,7 @@ logs /secret.txt decode.sh base64privKey.txt +privKey.pem +pubKey +private.pgp privKey.pem \ No newline at end of file diff --git a/Makefile b/Makefile index 8cc26ef..cab4d11 100644 --- a/Makefile +++ b/Makefile @@ -25,4 +25,4 @@ finstall: mvn install -Dmaven.test.skip=true doc: - mvn javadoc:javadoc \ No newline at end of file + mvn javadoc:javadoc From 155f3c78c4bdd8cc45f54c36c9837364b9cfae56 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:49:30 +0200 Subject: [PATCH 09/23] fix: publish github package --- .github/workflows/publish-package.yml | 39 +-- pom.xml | 369 ++++++++++++++------------ 2 files changed, 211 insertions(+), 197 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 2533312..f329168 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -12,36 +12,21 @@ jobs: contents: read packages: write steps: - - name: Install GPG key - run: | - echo "Installing GNUPG..." - sudo apt-get install gnupg - echo "Importing GPG key..." - echo -n "${{ secrets.OSSRH_GPG_PRIVATE_KEY }}" | base64 -d | gpg --batch --import - echo "GPG key imported." - - name: Pull the code from the repository - uses: actions/checkout@v3 + ########################################## + # 1 - PUSH TO MAVEN CENTRAL + ########################################## + ########################################## + # 2 - PUSH TO GITHUB PACKAGE + ########################################## + # STEP 1: Set up Java for publishing to Maven Central Repository - name: Set up Java for publishing to Maven Central Repository uses: actions/setup-java@v3 with: java-version: '17' distribution: 'adopt' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Register key to Ubuntu Keyserver - run: gpg --keyserver keyserver.ubuntu.com --send-keys ${{ secrets.OSSRH_GPG_KEY_ID }} - - name: Publish to the Maven Central Repository - run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - - name: Set up Java for publishing to GitHub Packages - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' + server-id: github + server-username: github + server-password: ${{ secrets.GITHUB_TOKEN }} + # STEP 2: Publish to GitHub Packages - name: Publish to GitHub Packages - run: mvn --batch-mode deploy -Dmaven.test.skip=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: mvn --batch-mode deploy -Dmaven.test.skip=true -P github diff --git a/pom.xml b/pom.xml index 60bd5d6..3b608d6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,186 +1,215 @@ - 4.0.0 - net.botlify.brightdata - bright-data-api + 4.0.0 + net.botlify.brightdata + bright-data-api - BrightData API - 1.0 - https://github.com/botlify-io/bright-data-api - An interface to communicate simpler with brightdata.com + BrightData API + 1.0 + https://github.com/botlify-io/bright-data-api + An interface to communicate simpler with brightdata.com - - Botlify - https://github.com/botlify-io - + + Botlify + https://github.com/botlify-io + - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + - - - Botlify - https://github.com/botlify-net - Europe/Paris - - + + + Botlify + https://github.com/botlify-net + Europe/Paris + + - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - + + + ossrh + + true + + + + ossrh + Maven Central + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + Maven Central + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + + + + + github + + + github + GitHub + https://maven.pkg.github.com/botlify-io/bright-data-api + + + github + GitHub + https://maven.pkg.github.com/botlify-io/bright-data-api + + + + - - scm:github:https://github.com/botlify-io/bright-data-api - scm:github:https://github.com/botlify-io/bright-data-api - https://github.com/botlify-io/bright-data-api - master - + + scm:github:https://github.com/botlify-io/bright-data-api + scm:github:https://github.com/botlify-io/bright-data-api + https://github.com/botlify-io/bright-data-api + master + - - UTF-8 - UTF-8 - + + UTF-8 + UTF-8 + - - - org.projectlombok - lombok - 1.18.26 - compile - - - com.squareup.okhttp3 - okhttp - 5.0.0-alpha.11 - - - org.apache.logging.log4j - log4j-core - 2.20.0 - - - org.apache.logging.log4j - log4j-api - 2.20.0 - - - org.jetbrains - annotations - 24.0.1 - - - org.json - json - 20230227 - - - org.junit.jupiter - junit-jupiter-engine - 5.9.2 - test - - - com.google.guava - guava - 31.1-jre - - + + + org.projectlombok + lombok + 1.18.26 + compile + + + com.squareup.okhttp3 + okhttp + 5.0.0-alpha.11 + + + org.apache.logging.log4j + log4j-core + 2.20.0 + + + org.apache.logging.log4j + log4j-api + 2.20.0 + + + org.jetbrains + annotations + 24.0.1 + + + org.json + json + 20230227 + + + org.junit.jupiter + junit-jupiter-engine + 5.9.2 + test + + + com.google.guava + guava + 31.1-jre + + - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - - + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.5.0 - - 1.8 - - - - attach-javadocs - - jar - - - - + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + 1.8 + + + + attach-javadocs + + jar + + + + - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - 1.8 - 1.8 - - + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 1.8 + 1.8 + + - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://s01.oss.sonatype.org/ - true - - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - - --pinentry-mode - loopback - - - - sign - - - - - - + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + + --pinentry-mode + loopback + + + + sign + + + + + + From 973589930b8f7b9d34d6701f9bb15d7bd08cff42 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:55:33 +0200 Subject: [PATCH 10/23] fix: github package deployment --- .github/workflows/publish-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index f329168..0364cf3 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -19,7 +19,7 @@ jobs: # 2 - PUSH TO GITHUB PACKAGE ########################################## # STEP 1: Set up Java for publishing to Maven Central Repository - - name: Set up Java for publishing to Maven Central Repository + - name: Set up Java for publishing to GitHub Package uses: actions/setup-java@v3 with: java-version: '17' @@ -29,4 +29,4 @@ jobs: server-password: ${{ secrets.GITHUB_TOKEN }} # STEP 2: Publish to GitHub Packages - name: Publish to GitHub Packages - run: mvn --batch-mode deploy -Dmaven.test.skip=true -P github + run: mvn --batch-mode deploy -Dmaven.test.skip=true -P "github" From 17d7df6a194abbcdfd7cf219a722b2be04a9699a Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:57:07 +0200 Subject: [PATCH 11/23] fix: github package deployment --- .github/workflows/publish-package.yml | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 0364cf3..99f211f 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -15,6 +15,35 @@ jobs: ########################################## # 1 - PUSH TO MAVEN CENTRAL ########################################## + # STEP 1: Install GPG key + - name: Install GPG key + run: | + echo "Installing GNUPG..." + sudo apt-get install gnupg + echo "Importing GPG key..." + echo -n "${{ secrets.OSSRH_GPG_PRIVATE_KEY }}" | base64 -d | gpg --batch --import + echo "GPG key imported." + # STEP 2: Register key to Ubuntu Keyserver + - name: Register key to Ubuntu Keyserver + run: gpg --keyserver keyserver.ubuntu.com --send-keys ${{ secrets.OSSRH_GPG_KEY_ID }} + # STEP 3: Pull the code from the repository + - name: Pull the code from the repository + uses: actions/checkout@v3 + # STEP 4: Set up Java for publishing to Maven Central Repository + - name: Set up Java for publishing to Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + # STEP 5: Publish to the Maven Central Repository + - name: Publish to the Maven Central Repository + # run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} ########################################## # 2 - PUSH TO GITHUB PACKAGE ########################################## From 347cdf228d284b3019c5add1773c291e9d9aeb5f Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:57:56 +0200 Subject: [PATCH 12/23] fix: github package deployment --- .github/workflows/publish-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 99f211f..58b52ad 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -40,6 +40,7 @@ jobs: server-password: MAVEN_PASSWORD # STEP 5: Publish to the Maven Central Repository - name: Publish to the Maven Central Repository + run: echo "ok" # run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} From 0887dd938800e6e1e6b2a721bc6530b664316ef0 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:01:17 +0200 Subject: [PATCH 13/23] fix: github package deployment --- pom.xml | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 3b608d6..11e2f63 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,27 @@ true + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + + --pinentry-mode + loopback + + + + sign + + + + @@ -187,28 +208,6 @@ 1.8 - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - - --pinentry-mode - loopback - - - - sign - - - - From cad170143304a3f6f31182241dfca59e755a1b66 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:02:50 +0200 Subject: [PATCH 14/23] fix: github package deployment --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 11e2f63..278381a 100644 --- a/pom.xml +++ b/pom.xml @@ -95,12 +95,12 @@ github GitHub - https://maven.pkg.github.com/botlify-io/bright-data-api + https://maven.pkg.github.com/botlify-net/bright-data-api github GitHub - https://maven.pkg.github.com/botlify-io/bright-data-api + https://maven.pkg.github.com/botlify-net/bright-data-api From ee07a47be5da0fff67d5f5d36d7c5b8d3d630551 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:04:27 +0200 Subject: [PATCH 15/23] fix: github package deployment --- .github/workflows/publish-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 58b52ad..2a20c08 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -55,8 +55,8 @@ jobs: java-version: '17' distribution: 'adopt' server-id: github - server-username: github - server-password: ${{ secrets.GITHUB_TOKEN }} # STEP 2: Publish to GitHub Packages - name: Publish to GitHub Packages run: mvn --batch-mode deploy -Dmaven.test.skip=true -P "github" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 98273f46dee75e96e9745e527ec00b692a40026f Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:06:21 +0200 Subject: [PATCH 16/23] fix: final fix of publish package workflow --- .github/workflows/publish-package.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 2a20c08..059ca71 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,9 +1,9 @@ name: Publish package -on: [push] - #workflow_run: - # workflows: ["Create Release"] - # types: [completed] +on: + workflow_run: + workflows: ["Create Release"] + types: [completed] jobs: publish: @@ -40,8 +40,7 @@ jobs: server-password: MAVEN_PASSWORD # STEP 5: Publish to the Maven Central Repository - name: Publish to the Maven Central Repository - run: echo "ok" - # run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} + run: mvn --batch-mode deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} From 3c04b1434436b5dba70301a4dc5daf91fd8c50a1 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:18:07 +0200 Subject: [PATCH 17/23] add: checkstyle in pom.xml --- pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index 278381a..1d0880d 100644 --- a/pom.xml +++ b/pom.xml @@ -208,6 +208,16 @@ 1.8 + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.2.1 + + checkstyle.xml + + From 24208d40b19f662b98a2a3cd27bc8375488bd734 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:30:31 +0200 Subject: [PATCH 18/23] rm: checkstyle --- pom.xml | 10 ---------- src/main/java/net/botlify/brightdata/ZoneAPI.java | 5 ++--- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 1d0880d..278381a 100644 --- a/pom.xml +++ b/pom.xml @@ -208,16 +208,6 @@ 1.8 - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.2.1 - - checkstyle.xml - - diff --git a/src/main/java/net/botlify/brightdata/ZoneAPI.java b/src/main/java/net/botlify/brightdata/ZoneAPI.java index 778f572..d6b3925 100644 --- a/src/main/java/net/botlify/brightdata/ZoneAPI.java +++ b/src/main/java/net/botlify/brightdata/ZoneAPI.java @@ -10,7 +10,6 @@ import okhttp3.RequestBody; import okhttp3.Response; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Range; import org.json.JSONArray; import org.json.JSONObject; @@ -56,7 +55,7 @@ public class ZoneAPI extends SubAPI { .addHeader(authorizationHeader.name.utf8(), authorizationHeader.value.utf8()) .build(); - try (final Response response = client.newCall(request).execute()) { + try (Response response = client.newCall(request).execute()) { final String body = response.body().string(); brightDataAPI.assertResponse(response.code(), body); return (new ZoneInformation(new JSONObject(body))); @@ -81,7 +80,7 @@ public boolean isZoneExist(@NotNull final String zoneName) throws IOException { .addHeader(authorizationHeader.name.utf8(), authorizationHeader.value.utf8()) .build(); - try (final Response response = client.newCall(request).execute()) { + try (Response response = client.newCall(request).execute()) { return (response.code() == 200); } } From a643b4a6932c235c106366f34dca9a2a5e6086de Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:31:35 +0200 Subject: [PATCH 19/23] add: more command in Makefile --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cab4d11..14ecc6c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ ## Generic Makefile for Botlify ## -.PHONY: all test clean fclean re doc +.PHONY: all test clean fclean install finstall re doc #================================= # Commands @@ -21,6 +21,12 @@ test: clean: mvn clean +fclean: + rm -rf target + +install: + mvn install + finstall: mvn install -Dmaven.test.skip=true From bfd2de2a919bd7533172051dc6f8e7ce4135f1f0 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:50:31 +0200 Subject: [PATCH 20/23] fix: readme with bad link on badge --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 12e4c05..4c206b9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Bright-data API -[![Latest release](https://img.shields.io/github/release/botlify-net/bright-data-api.svg)](https://github.com/botlify-io/bright-data-api/releases/latest) -[![Build Status](https://github.com/botlify-net/bright-data-api/workflows/Java%20CI/badge.svg?branch=master)](https://github.com/botlify-io/guava/bright-data-api/actions) +[![Latest release](https://img.shields.io/github/release/botlify-net/bright-data-api.svg)](https://github.com/botlify-net/bright-data-api/releases/latest) +[![Build Status](https://github.com/botlify-net/bright-data-api/workflows/Java%20CI/badge.svg?branch=master)](https://github.com/botlify-net/bright-data-api/actions) This project is a Java client for the BrightData API, which allows you to access the BrightData API from your Java application without having to deal with the HTTP requests. diff --git a/pom.xml b/pom.xml index 278381a..1c3e557 100644 --- a/pom.xml +++ b/pom.xml @@ -6,9 +6,9 @@ 4.0.0 net.botlify.brightdata bright-data-api + 1.0 BrightData API - 1.0 https://github.com/botlify-io/bright-data-api An interface to communicate simpler with brightdata.com From 4d0100f77964f143c56f7e64617d83be2af02046 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Thu, 6 Apr 2023 12:01:30 +0200 Subject: [PATCH 21/23] add: java doc in workflow --- .github/workflows/java-compilation.yml | 4 +++- pom.xml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java-compilation.yml b/.github/workflows/java-compilation.yml index 728d92f..3c9453e 100644 --- a/.github/workflows/java-compilation.yml +++ b/.github/workflows/java-compilation.yml @@ -14,4 +14,6 @@ jobs: java-version: '17' distribution: 'temurin' - name: Compilation with Maven - run: mvn compile \ No newline at end of file + run: mvn compile + - name: JavaDoc + run: mvn javadoc:javadoc \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1c3e557..5dc0737 100644 --- a/pom.xml +++ b/pom.xml @@ -187,9 +187,15 @@ 3.5.0 1.8 + true + true + + true + true + attach-javadocs jar From 44cbdeedddebfd1231d186199f26bf7c51d647d1 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Thu, 6 Apr 2023 12:48:05 +0200 Subject: [PATCH 22/23] fix: scm in pom.xml --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5dc0737..899dcae 100644 --- a/pom.xml +++ b/pom.xml @@ -107,9 +107,9 @@ - scm:github:https://github.com/botlify-io/bright-data-api - scm:github:https://github.com/botlify-io/bright-data-api - https://github.com/botlify-io/bright-data-api + scm:github:https://github.com/botlify-net/bright-data-api + scm:github:https://github.com/botlify-net/bright-data-api + https://github.com/botlify-net/bright-data-api master From d8693ea5a7ca01a7c08099d6b7ab9511044e39f1 Mon Sep 17 00:00:00 2001 From: Florian <91879250+florianepitech@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:30:49 +0200 Subject: [PATCH 23/23] add: CreateZoneRequest return instance on all setter --- .github/workflows/publish-release.yml | 5 +- CHANGELOG.md | 5 +- pom.xml | 2 +- .../brightdata/request/CreateZoneRequest.java | 198 ++++++++++++++++-- 4 files changed, 185 insertions(+), 25 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 17f50d2..62df24b 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -15,11 +15,12 @@ jobs: - name: Pull the code from the repository uses: actions/checkout@v3 # Set up JDK 17 for the build (maven included). - - name: Set up JDK 17 + - name: Set up Java for publishing to GitHub Package uses: actions/setup-java@v3 with: java-version: '17' - distribution: 'temurin' + distribution: 'adopt' + server-id: github # Build the project with Maven. - name: Compilation with Maven run: mvn compile diff --git a/CHANGELOG.md b/CHANGELOG.md index c4c4c51..3e5ea29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,2 @@ -Features: -- Add zone management to the API. -- Add the request to get account balance to the account api. \ No newline at end of file +Fix: +- Set CreateZoneRequest to return the instance of the request on the setters. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 899dcae..c40cacf 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 net.botlify.brightdata bright-data-api - 1.0 + 1.1 BrightData API https://github.com/botlify-io/bright-data-api diff --git a/src/main/java/net/botlify/brightdata/request/CreateZoneRequest.java b/src/main/java/net/botlify/brightdata/request/CreateZoneRequest.java index 78f4161..a6283b8 100644 --- a/src/main/java/net/botlify/brightdata/request/CreateZoneRequest.java +++ b/src/main/java/net/botlify/brightdata/request/CreateZoneRequest.java @@ -31,97 +31,97 @@ public class CreateZoneRequest { /** * The type of ips to use. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private IpType ipsType; /** * The bandwidth type. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private BandwidthType bandwidthType; /** * The ip allocation preset type. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private IpAllocPresetType ipAllocPresetType; /** * The number of ip to allocate. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Integer ipToAllocate; /** * The country code of the zone ips. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private String country; /** * The country city of the zone ips. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private String countryCity; /** * The boolean to use mobile ips. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Boolean mobile; /** * The serp boolean. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Boolean serp; /** * The city targeting permission boolean. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Boolean cityTargetingPermission; /** * The asn targeting permission boolean. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Boolean enablingAsnTargetingPermission; /** * The boolean to use vip ips. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Boolean vip; /** * The vip type. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private VipsType vipsType; /** * The number of vip ips to use. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private Integer vips; /** * The list of domains to whitelist. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) - private List domainWitelist; + @Nullable @Getter + private List domainWhitelist; /** * The vip country code. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private String vipCountry; /** * The vip country city. */ - @Nullable @Getter @Setter(AccessLevel.PUBLIC) + @Nullable @Getter private String vipCountryCity; /** @@ -174,8 +174,8 @@ public CreateZoneRequest(@NotNull final String name, plan.put("vips_type", vipsType.toString()); if (vips != null) plan.put("vips", vips); - if (domainWitelist != null) - plan.put("domain_whitelist", domainWitelist); + if (domainWhitelist != null) + plan.put("domain_whitelist", domainWhitelist); if (vipCountry != null) plan.put("vip_country", vipCountry); if (vipCountryCity != null) @@ -184,4 +184,164 @@ public CreateZoneRequest(@NotNull final String name, return (result); } + /** + * Set the country code of the zone ips. + * @param ipsType The country code of the zone ips. + * @return This request. + */ + public @NotNull CreateZoneRequest setIpsType(@Nullable final IpType ipsType) { + this.ipsType = ipsType; + return (this); + } + + /** + * Set the bandwidth type. + * @param bandwidthType The bandwidth type. + * @return This request. + */ + public @NotNull CreateZoneRequest setBandwidthType(@Nullable final BandwidthType bandwidthType) { + this.bandwidthType = bandwidthType; + return (this); + } + + /** + * Set the ip allocation preset type. + * @param ipAllocPresetType The ip allocation preset type. + * @return This request. + */ + public @NotNull CreateZoneRequest setIpAllocPresetType(@Nullable final IpAllocPresetType ipAllocPresetType) { + this.ipAllocPresetType = ipAllocPresetType; + return (this); + } + + /** + * Set the number of ip to allocate. + * @param ipToAllocate The number of ip to allocate. + * @return This request. + */ + public @NotNull CreateZoneRequest setIpToAllocate(@Nullable final Integer ipToAllocate) { + this.ipToAllocate = ipToAllocate; + return (this); + } + + /** + * Set the country code. + * @param country The country code. + * @return This request. + */ + public @NotNull CreateZoneRequest setCountry(@Nullable final String country) { + this.country = country; + return (this); + } + + /** + * Set the country city. + * @param countryCity The country city. + * @return This request. + */ + public @NotNull CreateZoneRequest setCountryCity(@Nullable final String countryCity) { + this.countryCity = countryCity; + return (this); + } + + /** + * Set the mobile boolean. + * @param mobile The mobile boolean. + * @return This request. + */ + public @NotNull CreateZoneRequest setMobile(@Nullable final Boolean mobile) { + this.mobile = mobile; + return (this); + } + + /** + * Set the serp boolean. + * @param serp The serp boolean. + * @return This request. + */ + public @NotNull CreateZoneRequest setSerp(@Nullable final Boolean serp) { + this.serp = serp; + return (this); + } + + /** + * Set the city targeting permission boolean. + * @param cityTargetingPermission The city targeting permission boolean. + * @return This request. + */ + public @NotNull CreateZoneRequest setCityTargetingPermission(@Nullable final Boolean cityTargetingPermission) { + this.cityTargetingPermission = cityTargetingPermission; + return (this); + } + + /** + * Set the asn targeting permission boolean. + * @param enablingAsnTargetingPermission The asn targeting permission boolean. + * @return This request. + */ + public @NotNull CreateZoneRequest setEnablingAsnTargetingPermission(@Nullable final Boolean enablingAsnTargetingPermission) { + this.enablingAsnTargetingPermission = enablingAsnTargetingPermission; + return (this); + } + + /** + * Set the domain whitelist. + * @param vip The boolean to use vip ips. + * @return This request. + */ + public @NotNull CreateZoneRequest setVip(@Nullable final Boolean vip) { + this.vip = vip; + return (this); + } + + /** + * Set the vip type. + * @param vipsType The vip type. + * @return This request. + */ + public @NotNull CreateZoneRequest setVipsType(@Nullable final VipsType vipsType) { + this.vipsType = vipsType; + return (this); + } + + /** + * Set the number of vip ips to use. + * @param vips The number of vip ips to use. + * @return This request. + */ + public @NotNull CreateZoneRequest setVips(@Nullable final Integer vips) { + this.vips = vips; + return (this); + } + + /** + * Set the domain whitelist. + * @param domainWhitelist The domain whitelist. + * @return This request. + */ + public @NotNull CreateZoneRequest setDomainWhitelist(@Nullable final List domainWhitelist) { + this.domainWhitelist = domainWhitelist; + return (this); + } + + /** + * Set the vip country. + * @param vipCountry The vip country. + * @return This request. + */ + public @NotNull CreateZoneRequest setVipCountry(@Nullable final String vipCountry) { + this.vipCountry = vipCountry; + return (this); + } + + /** + * Set the vip country city. + * @param vipCountryCity The vip country city. + * @return This request. + */ + public @NotNull CreateZoneRequest setVipCountryCity(@Nullable final String vipCountryCity) { + this.vipCountryCity = vipCountryCity; + return (this); + } + }