Skip to content

Commit

Permalink
Adding changes for push to jfog
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakaracic committed Nov 22, 2024
1 parent ed05876 commit d1d876f
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 15 deletions.
53 changes: 53 additions & 0 deletions .github/actions/release-to-jfrog/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish artifacts to JFrog
description: Publishes artifacts to Sonatype

inputs:
version:
description: "Version of client to build"
required: true
crypto-type:
description: Crypto type. This should either be bouncycastle or gnu
required: true
maven-username:
description: Maven repo username
required: true
maven-token:
description: Maven repo password
required: true
gpg-signing-key:
description: GPG private signing key
required: true
gpg-signing-key-password:
description: GPG private signing key password
required: true
module:
description: Module to publish
required: true

runs:
using: "composite"
steps:
- name: Set version
shell: bash
run: mvn versions:set -DnewVersion=${{ inputs.version }}

- name: Build
shell: bash
run: |
echo "-${{ inputs.crypto-type }}-"
mvn clean install -Dcrypto.type=${{ inputs.crypto-type }}
- name: Build source jar
run: mvn source:jar -Dcrypto.type=${{ inputs.crypto-type }}
shell: bash
working-directory: ${{ inputs.module }}

- name: Build docs
run: mvn javadoc:jar -Dcrypto.type=${{ inputs.crypto-type }}
shell: bash
working-directory: ${{ inputs.module }}

- name: Debug list content
shell: bash
run: |
ls -R | grep ".*.jar"
2 changes: 1 addition & 1 deletion .github/actions/upload-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
- name: Upload from branches to JFrog
shell: bash
# Only interested in `aerospike-proxy-client-x.x.x....` and `aerospike-client-jdkx-x.x.x....`
run: jf rt upload --regexp=true --dry-run "aerospike-(proxy-client|client-(jdk\d+))-\d+\.\d+\.\d+(-jar-with-dependencies)?\.jar" "${{ inputs.jfrog-repo-name }}"
run: jf rt upload --regexp=true --dry-run "aerospike-(client-(jdk\d+))-\d+\.\d+\.\d+(-jar-with-dependencies)?\.jar" "${{ inputs.jfrog-repo-name }}"

- name: Publish build info
shell: bash
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
required: false
default: false
description: "Bump artifact version"
run-tests:
type: boolean
required: false
default: false
description: Spin up aerospike enterprise server and run tests

jobs:
debug-job:
Expand Down Expand Up @@ -68,21 +73,15 @@ jobs:
build:
uses: ./.github/workflows/build.yaml
needs: java-version
strategy:
matrix:
crypto-type: ["bouncycastle", "gnu"]
with:
java-version: ${{ needs.java-version.outputs.java-version }}
branch: ${{ inputs.branch }}
use-server-rc: ${{ inputs.use-server-rc }}
run-tests: ${{ inputs.run-tests }}
server-tag: ${{ inputs.server-tag }}
upload-artifacts: ${{ inputs.upload-artifacts }}
crypto-type: ${{ matrix.crypto-type }}
secrets: inherit

# build-java-8:
# if: ${{ inputs.source-branch == 'dev-jdk8/*' }}
# uses: ./.github/workflows/build.yaml
# with:
# java-version: 8
# branch: ${{ inputs.branch }}
# use-server-rc: ${{ inputs.use-server-rc }}
# server-tag: ${{ inputs.server-tag }}
# upload-artifacts: ${{ inputs.upload-artifacts }}
# secrets: inherit
29 changes: 26 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ on:
required: false
default: false
description: "Upload built artifacts to github?"
run-tests:
type: boolean
required: false
default: false
description: Spin up aerospike enterprise server and run tests
crypto-type:
type: string
required: true

secrets:
JFROG_USERNAME:
required: true
Expand Down Expand Up @@ -55,21 +64,35 @@ jobs:
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASS }}

- name: Build
run: mvn install -Dcrypto.type=${{ inputs.client-type == 'bouncycastle' && '-bc' || '' }}

- name: Run EE server
if: ${{ input.run-tests == true }}
uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.JFROG_USERNAME }}
docker-hub-password: ${{ secrets.JFROG_DOCKER_TOKEN }}

- name: Build
run: mvn install

- name: Test
if: ${{ input.run-tests == true }}
working-directory: test
run: mvn test -DskipTests=false

- name: Generate docs jar
if: ${{ !cancelled() && inputs.upload-artifacts == true }}
working-directory: client
run: |
mvn javadoc:jar
- name: Generate sources jar
if: ${{ !cancelled() && inputs.upload-artifacts == true }}
working-directory: client
run: |
mvn source:jar
- name: Upload to JFrog
if: ${{ !cancelled() && inputs.upload-artifacts == true }}
uses: ./.github/actions/upload-to-jfrog
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-request-open-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ jobs:
source-branch: ${{ inputs.source-branch || github.base_ref }}
use-server-rc: true
upload-artifacts: false
run-tests: true
secrets: inherit

0 comments on commit d1d876f

Please sign in to comment.