diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 000277e..8a47988 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -13,35 +13,19 @@ jobs: java-version: 11 - name: Setup Gradle 🐘 uses: gradle/gradle-build-action@v2 + - name: Prepare Artifactory 🐸 + uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: "https://${{ secrets.ARTIFACTORY_HOST }}" + JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} - name: Make gradlew executable run: chmod +x ./gradlew - name: Run build with Gradle Wrapper 🏃 run: ./gradlew build -x test - name: Run tests 🧑‍⚕️ run: ./gradlew test - # Might want to remove this step - - name: Archive production artifacts ⬆️ - if: ${{ github.event_name == 'pull_request' && github.pull_request_target == 'master' }} - uses: actions/upload-artifact@v3 - with: - name: Artifacts - path: ./build/libs/saRestApi-*.jar - - uses: jfrog/setup-jfrog-cli@v3 - env: - JF_URL: ${{ secrets.ARTIFACTORY_URL }} - JF_USER: ${{ secrets.JFROG_USERNAME }} - JF_PASSWORD: ${{ secrets.JFROG_PASSWORD }} - - run: | - # This command adds a new server configuration to the JFrog CLI - name: Upload to artifactory - if: ${{ github.event_name == 'pull_request' }} run: | - export BUILD_NAME="saidp-sdk-java" - export BUILD_MODULE="sdk-java" - export BUILD_NUMBER="1" - export VERSION=$(cat gradle.properties | grep -Po "\d*\.\d*\.\d*\.\d*") - jf rt upload "./build/libs/saRestApi-*.jar" radius-release-local/saRestApi/$VERSION/saRestApi-$VERSION.jar --build-name $BUILD_NAME --build-number $BUILD_NUMBER --module $BUILD_MODULE - jf rt build-publish $BUILD_NAME $BUILD_NUMBER - - run: echo "🍏 This job's status is ${{ job.status }}." + jf rt u "./build/libs/saRestApi-*.jar" saidp-dev/radius/saRestApi/$VERSION/saRestApi-$VERSION.jar diff --git a/build.gradle b/build.gradle index c03423f..0843364 100644 --- a/build.gradle +++ b/build.gradle @@ -16,9 +16,12 @@ repositories { mavenCentral() maven { url artifactory_repo - credentials { - username = artifactory_user - password = artifactory_key + authentication { + header(HttpHeaderAuthentication) + } + credentials(HttpHeaderCredentials) { + name = "Authorization" + value = "Bearer ${artifactory_token}" } metadataSources { artifact() diff --git a/gradle.properties b/gradle.properties index 584124c..5d8561e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,3 @@ currentVersion=1.1.0.13 -artifactory_repo=https://secureauthcloud.jfrog.io/artifactory/ -artifactory_user= -artifactory_key= +artifactory_repo=https://artifacts.secureauth.com +artifactory_token=