diff --git a/.github/actions/release-to-jfrog/actions.yaml b/.github/actions/release-to-jfrog/actions.yaml new file mode 100644 index 000000000..18042b361 --- /dev/null +++ b/.github/actions/release-to-jfrog/actions.yaml @@ -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" diff --git a/.github/actions/upload-to-jfrog/action.yaml b/.github/actions/upload-to-jfrog/action.yaml index 722a079ae..eef7083b2 100644 --- a/.github/actions/upload-to-jfrog/action.yaml +++ b/.github/actions/upload-to-jfrog/action.yaml @@ -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 diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 98997f780..2a47beab5 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -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: @@ -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 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fc46e205e..d7a47302f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 @@ -55,7 +64,11 @@ 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 }} @@ -63,13 +76,23 @@ jobs: 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 diff --git a/.github/workflows/pull-request-open-dev.yaml b/.github/workflows/pull-request-open-dev.yaml index 470c02f92..bc8b0ae0b 100644 --- a/.github/workflows/pull-request-open-dev.yaml +++ b/.github/workflows/pull-request-open-dev.yaml @@ -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