diff --git a/.github/settings.xml b/.github/settings.xml index 9b76fc4..6cc0fe2 100644 --- a/.github/settings.xml +++ b/.github/settings.xml @@ -1,13 +1,19 @@ - - - github - ${env.MAVEN_USERNAME} - ${env.MAVEN_PASSWORD} - - + + + github + ${env.MAVEN_USERNAME} + ${env.MAVEN_PASSWORD} + + + central + ${{env.OSSRH_USERNAME_TOKEN }} + ${{env.OSSRH_PASSWORD_TOKEN }} + + + \ No newline at end of file diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 83864ed..3116191 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -16,38 +16,40 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '8' + java-version: '17' distribution: 'temurin' cache: maven - name: Setup GPG + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | echo "Setting up GPG..." mkdir -p ~/.gnupg chmod 700 ~/.gnupg - # Import private key - echo "${{ secrets.GPG_PRIVATE_KEY }}" > private.key - echo "Importing GPG key..." - gpg --batch --import private.key - rm private.key - - # Configure GPG - echo "Configuring GPG..." - cat > ~/.gnupg/gpg.conf << EOF - default-key ${{ secrets.GPG_KEYNAME }} - use-agent - pinentry-mode loopback - EOF + # Debug: Sprawdź długość klucza + echo "GPG_PRIVATE_KEY length: ${#GPG_PRIVATE_KEY}" - # Debug information - echo "=== GPG Keys ===" - gpg --list-secret-keys --keyid-format LONG - gpg --list-keys --keyid-format LONG - + # Debug: Sprawdź początek klucza (bez ujawniania tajemnicy) + echo "GPG_KEYNAME: $GPG_KEYNAME" + echo "GPG_PASSPHRASE length: ${#GPG_PASSPHRASE}" + echo "First 10 chars of GPG_PRIVATE_KEY: ${GPG_PRIVATE_KEY:0:10}" + + # Tepporary write key for debug + echo "$GPG_PRIVATE_KEY" > private.tmp + echo "File content (first line): $(head -1 private.tmp)" + + # Import key + echo "Importing GPG key..." + gpg --batch --import private.tmp || echo "Import failed!" + rm private.tmp + - name: Configure Maven run: | mkdir -p ~/.m2 @@ -74,21 +76,23 @@ jobs: EOF - + - name: Build and Publish env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD_TOKEN }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} run: | echo "Starting Maven build and deploy..." mvn clean deploy -P release \ -Dmaven.javadoc.skip=false \ -Dmaven.deploy.skip=false \ - -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ - -Dgpg.useagent=true \ + -Dgpg.keyname=$GPG_KEYNAME \ + -Dgpg.useagent=false \ + -Dgpg.passphrase=$GPG_PASSPHRASE \ -Dmaven.test.failure.ignore=false \ - -DaltDeploymentRepository=ossrh::default::https://central.sonatype.com/api/v1/publisher/upload \ + -DaltDeploymentRepository=ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \ -DrepositoryId=ossrh \ - -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ - -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ No newline at end of file + -Dusername=$OSSRH_USERNAME \ + -Dpassword=$OSSRH_PASSWORD diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b67a0b7..88a5062 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,10 +15,10 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '8' + java-version: '17' distribution: 'temurin' cache: 'maven' @@ -31,14 +31,4 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v1 with: - name: Release ${{ github.ref_name }} - draft: false - prerelease: false - generate_release_notes: true - files: | - target/qualtrics-api-client-0.1.2.jar - target/qualtrics-api-client-0.1.2-sources.jar - target/qualtrics-api-client-0.1.2-javadoc.jar - target/site/apidocs/** - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + name: diff --git a/README.md b/README.md index 9e69932..0772ccd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Java Version](https://img.shields.io/badge/Java-17%2B-blue)](https://www.java.com) +[![Maven Central](https://img.shields.io/maven-central/v/pl.wtx.qualtrics/qualtrics-api-client?label=Maven%20Central&logo=apache-maven&color=blue)](https://mvnrepository.com/artifact/pl.wtx.qualtrics/qualtrics-api-client) A lightweight Java client library for Qualtrics API integration. Built for Java developers who need to integrate their applications with the Qualtrics Employee Experience platform. 🚀 @@ -89,7 +90,25 @@ The only requirement is to preserve the original author attribution in the sourc ### 1️⃣ Installation -Clone and build the library from source: +You can add the library to your project by including the dependency from Maven Central: +```xml + + + pl.wtx.qualtrics + qualtrics-api-client + 0.1.2 + +``` + +Alternatively, clone and build the library from source: + +```sh +git clone https://github.com/wtx-labs/qualtrics-api-client-java.git +cd qualtrics-api-client-java +mvn clean install +``` + +Then add the locally built artifact to your project: ```sh git clone https://github.com/wtx-labs/qualtrics-api-client-java.git diff --git a/pom.xml b/pom.xml index 0735561..3d34dcd 100644 --- a/pom.xml +++ b/pom.xml @@ -133,6 +133,7 @@ attach-javadocs + package jar