Skip to content

Commit

Permalink
Integration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakaracic committed Dec 27, 2024
1 parent 1a9f6b4 commit 470f771
Show file tree
Hide file tree
Showing 24 changed files with 562 additions and 136 deletions.
16 changes: 9 additions & 7 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ inputs:
required: false
default: "latest"
description: "Server docker image tag"
jfrog_docker_username:
jfrog-docker-username:
required: true
description: ""
jfrog_docker_token:
jfrog-docker-token:
required: true
description: ""
run-tests:
Expand All @@ -28,25 +28,27 @@ inputs:
runs:
using: "composite"
steps:
# Using script to set profile since we would like to have the sticky effect. Set it once and have it
# remain for remainder of the job
- name: Stage crypto
shell: bash
run: |
./set_cypto ${{ inputs.crypto-type }}
./set_crypto ${{ inputs.crypto-type }}
- name: Build
shell: bash
run: mvn clean install -P ${{ inputs.crypto-type }}
run: mvn clean install

- name: Run EE server
if: ${{ inputs.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: ${{ inputs.jfrog_docker_username }}
docker-hub-password: ${{ inputs.jfrog_docker_token }}
docker-hub-username: ${{ inputs.jfrog-docker-username }}
docker-hub-password: ${{ inputs.jfrog-docker-token }}

- name: Test
- name: Run tests
shell: bash
if: ${{ inputs.run-tests == true }}
working-directory: test
Expand Down
36 changes: 0 additions & 36 deletions .github/actions/fast-forward-merge/action.yaml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/actions/github-release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create github release
description: Creates a github release

inputs:
artifact-version:
description: ""
required: true
github-token:
description: ""
required: true

runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get previous tag
shell: bash
id: get-prev-tag
run: |
# Fetch all tags
git fetch --tags
echo "previous-tag=$(git tag --sort=-creatordate | sed -n '1p')" >> $GITHUB_OUTPUT
# Extract commit messages between previous tag and the current tag.
- name: Get release notes
shell: bash
id: release-notes
run: |
notes=$(git log "${{ steps.get-previous-tag.outputs.previous-tag }}..HEAD" --pretty=format:"%s" --no-merges)
# GitHub Actions requires that multiline output is escaped:
notes="${notes//'%'/'%25'}"
notes="${notes//$'\n'/'%0A'}"
notes="${notes//$'\r'/'%0D'}"
echo "notes=$notes" >> $GITHUB_OUTPUT
- name: Debug
shell: bash
run: |
echo "artifact-version: ${{ inputs.artifact-version }}"
echo "body: ${{ steps.release-notes.outputs.notes }}"
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: ${{ inputs.artifact-version }}
tag_exists_error: false
message: "Latest release"
68 changes: 56 additions & 12 deletions .github/actions/publish-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,84 @@ inputs:
jfrog-platform-url:
description: ""
required: false
default: https://aerospike.jfrog.io/
default: https://aerospike.jfrog.io
oidc-provider:
description: ""
required: false
default: gh-aerospike-clients
required: true
oidc-audience:
description: ""
required: false
default: aerospike/clients
required: true
crypto-type:
description: ""
required: false
default: gnu
artifact-name:
description: ""
required: true
artifact-id:
description: ""
required: true
artifact-version:
description: ""
required: true
deploy-spec-path:
description: ""
required: false
default: deploy-resources

runs:
using: "composite"
steps:
- name: Set up JFrog credentials
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
with:
version: 2.72.2
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Set crypto dependency
- name: Configure jf cli
shell: bash
run: |
jf mvn-config \
--repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} \
--repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }}
- name: Generate deploy spec
shell: bash
working-directory: client
run: |
./set_crypto ${{ inputs.crypto-type }}
jq --arg targetPattern "${{ inputs.jfrog-releases-repo-name }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/" \
--arg publicPomPattern "deploy-resources/${{ inputs.crypto-type }}_pom.xml" \
--arg publicPomTarget "${{ inputs.jfrog-releases-repo-name }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/${{ inputs.artifact-name }}.pom" \
'
.files[0].target = $targetPattern |
.files[1].target = $targetPattern |
.files[2].pattern = $publicPomPattern |
.files[2].target = $publicPomTarget
' ${{ inputs.deploy-spec-path }}/publish-spec.json.template > ${{ inputs.deploy-spec-path }}/publish-spec.json
- name: Deploy release
- name: Debug deploy spec
shell: bash
working-directory: client
run: |
jf mvn-config --repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} --repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }}
jf mvn source:jar javadoc:jar deploy -Dusername=${{ steps.setup-jfrog-cli.outputs.oidc-user }} ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
jf rt bp
cat ${{ inputs.deploy-spec-path }}/publish-spec.json
- name: Upload artifacts
shell: bash
working-directory: client
run: |
jf rt upload --spec=${{ inputs.deploy-spec-path }}/publish-spec.json \
--module=${{ inputs.artifact-id }} \
--build-name=clients-java-push-to-dev_${{ inputs.artifact-id }} \
--build-number=${{ github.run_number }}
# record env variables
jf rt bce clients-java-push-to-dev_${{ inputs.artifact-id }} ${{ github.run_number }}
# record git info
jf rt bag clients-java-push-to-dev_${{ inputs.artifact-id }} ${{ github.run_number }}
# publish build info
jf rt bp clients-java-push-to-dev_${{ inputs.artifact-id }} ${{ github.run_number }}
66 changes: 66 additions & 0 deletions .github/actions/publish-to-sonatype/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish artifacts to Sonatype
description: "Publishes artifacts to Sonatype"

inputs:
jfrog-releases-repo-name:
description: ""
required: false
default: clients-maven-dev-local
jfrog-snapshots-repo-name:
description: ""
required: false
default: clients-maven-dev-local
jfrog-platform-url:
description: ""
required: false
default: https://aerospike.jfrog.io
oidc-provider:
description: ""
required: true
oidc-audience:
description: ""
required: true
artifact-name:
description: ""
required: true
artifact-version:
description: ""
required: true
staging-folder:
description: ""
required: false
default: staging
target-repository:
description: ""
required: false
default: clients-maven-stage-local

runs:
using: "composite"
steps:
- name: Set up JFrog credentials
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
with:
version: 2.72.2
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Create staging folder
shell: bash
run: |
mkdir -p ${{ inputs.staging-folder }}
- name: Download artifacts from JFrog
shell: bash
working-directory: ${{ inputs.staging-folder }}
run: |
jf rt dl "${{ inputs.target-repository }}/com/aerospike/${{ inputs.artifact-name }}/${{ inputs.artifact-version }}/*" .
- name: Debug list downloaded content
shell: bash
working-directory: ${{ inputs.staging-folder }}
run: |
ls -la
42 changes: 42 additions & 0 deletions .github/workflows/aggregate-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
permissions:
# This is required for requesting the OIDC token
id-token: write

on:
workflow_call:
inputs:
jfrog-platform-url:
type: string
description: ""
required: false
default: https://aerospike.jfrog.io
secrets:
GPG_SECRET_KEY:
required: true
GPG_PASS:
required: true
JFROG_OIDC_PROVIDER:
required: true
JFROG_OIDC_AUDIENCE:
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up JFrog credentials l
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
with:
version: 2.72.2
oidc-provider-name: ${{ secrets.JFROG_OIDC_PROVIDER }}
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}

- name: Aggregate builds
run: |
jf rt ba clients-java-push-to-dev ${{ github.run_number }} clients-java-push-to-dev_aerospike-client-bc-jdk21 ${{ github.run_number }}
jf rt ba clients-java-push-to-dev ${{ github.run_number }} clients-java-push-to-dev_aerospike-client-jdk21 ${{ github.run_number }}
jf rt bp clients-java-push-to-dev ${{ github.run_number }}
2 changes: 1 addition & 1 deletion .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
needs: java-version
strategy:
matrix:
crypto-type: ["bouncycastle", "gnu"]
crypto-type: [bouncycastle, gnu]
with:
java-version: ${{ needs.java-version.outputs.java-version }}
branch: ${{ inputs.branch }}
Expand Down
Loading

0 comments on commit 470f771

Please sign in to comment.