Skip to content

Commit 0686253

Browse files
committed
Integration fixes
1 parent 1a9f6b4 commit 0686253

File tree

14 files changed

+160
-87
lines changed

14 files changed

+160
-87
lines changed

.github/actions/build-and-test/action.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ runs:
3131
- name: Stage crypto
3232
shell: bash
3333
run: |
34-
./set_cypto ${{ inputs.crypto-type }}
34+
./set_crypto ${{ inputs.crypto-type }}
3535
3636
- name: Build
3737
shell: bash
38-
run: mvn clean install -P ${{ inputs.crypto-type }}
38+
run: mvn clean install
3939

4040
- name: Run EE server
4141
if: ${{ inputs.run-tests == 'true' }}

.github/actions/fast-forward-merge/action.yaml

-36
This file was deleted.

.github/actions/publish-to-jfrog/action.yaml

+44-12
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,72 @@ inputs:
1313
jfrog-platform-url:
1414
description: ""
1515
required: false
16-
default: https://aerospike.jfrog.io/
16+
default: https://aerospike.jfrog.io
1717
oidc-provider:
1818
description: ""
19-
required: false
20-
default: gh-aerospike-clients
19+
required: true
2120
oidc-audience:
2221
description: ""
23-
required: false
24-
default: aerospike/clients
22+
required: true
2523
crypto-type:
2624
description: ""
2725
required: false
28-
default: gnu
26+
artifact-name:
27+
description: ""
28+
required: true
29+
artifact-id:
30+
description: ""
31+
required: true
2932

3033
runs:
3134
using: "composite"
3235
steps:
3336
- name: Set up JFrog credentials
37+
id: setup-jfrog-cli
3438
uses: jfrog/setup-jfrog-cli@v4
3539
env:
3640
JF_URL: ${{ inputs.jfrog-platform-url }}
3741
with:
42+
version: 2.72.2
3843
oidc-provider-name: ${{ inputs.oidc-provider }}
3944
oidc-audience: ${{ inputs.oidc-audience }}
4045

41-
- name: Set crypto dependency
46+
- uses: s4u/[email protected]
47+
with:
48+
servers: '[{"id": "jfrog", "username": "${{ steps.setup-jfrog-cli.outputs.oidc-user }}", "password": "${{ steps.setup-jfrog-cli.outputs.oidc-token }}"}]'
49+
50+
- name: Configure jf cli
4251
shell: bash
4352
run: |
44-
./set_crypto ${{ inputs.crypto-type }}
53+
jf mvn-config \
54+
--repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} \
55+
--repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }} \
56+
--exclude-patterns="*client${{ inputs.crypto-type != 'bouncycastle' && '-bc' || '' }}-jdk21*"
4557
46-
- name: Deploy release
58+
- name: Debug
4759
shell: bash
4860
working-directory: client
4961
run: |
50-
jf mvn-config --repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} --repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }}
51-
jf mvn source:jar javadoc:jar deploy -Dusername=${{ steps.setup-jfrog-cli.outputs.oidc-user }} ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
52-
jf rt bp
62+
ls -la target
63+
64+
- name: Deploy client release
65+
shell: bash
66+
working-directory: client
67+
run: |
68+
jf mvn source:jar javadoc:jar install -f src/resources/${{ inputs.crypto-type }}_pom.xml
69+
70+
- name: Debug
71+
shell: bash
72+
working-directory: client
73+
run: |
74+
ls -la target
75+
76+
- name: Publish build info
77+
shell: bash
78+
run: |
79+
# Collect environment variables for the build
80+
jf rt bce
81+
# Collect VCS details from git and add them to the build
82+
jf rt bag
83+
# Publish build info
84+
jf rt bp clients-java-push-to-dev ${{ github.run_number }}

.github/workflows/build-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
needs: java-version
7676
strategy:
7777
matrix:
78-
crypto-type: ["bouncycastle", "gnu"]
78+
crypto-type: [bouncycastle, gnu]
7979
with:
8080
java-version: ${{ needs.java-version.outputs.java-version }}
8181
branch: ${{ inputs.branch }}

.github/workflows/build.yaml

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Build artifacts
2+
run-name: Build artifact for ${{ inputs.crypto-type }} ${{ inputs.java-version }}
23

34
permissions:
45
# This is required for requesting the OIDC token
@@ -41,12 +42,16 @@ on:
4142
required: true
4243
GPG_PASS:
4344
required: true
45+
JFROG_OIDC_PROVIDER:
46+
required: true
47+
JFROG_OIDC_AUDIENCE:
48+
required: true
4449

4550
jobs:
4651
build:
4752
runs-on: ubuntu-latest
4853
steps:
49-
- name: Checkout client
54+
- name: Checkout code
5055
uses: actions/checkout@v4
5156
with:
5257
ref: ${{ inputs.branch }}
@@ -66,8 +71,24 @@ jobs:
6671
server-tag: ${{ inputs.server-tag }}
6772
use-server-rc: ${{ inputs.use-server-rc }}
6873

74+
- name: Get artifact name
75+
id: get-artifact-name
76+
working-directory: client
77+
run: |
78+
echo artifact-name=$(mvn help:evaluate -Dexpression=project.build.finalName -q -DforceStdout) >> $GITHUB_OUTPUT
79+
80+
- name: Get artifact ID
81+
id: get-artifact-id
82+
working-directory: client
83+
run: |
84+
echo artifact-id="aerospike-client${{ inputs.crypto-type == 'bouncycastle' && '-bc' || '' }}-jdk${{ inputs.java-version }}" >> $GITHUB_OUTPUT
85+
6986
- name: Publish to JFrog
7087
if: ${{ !cancelled() && inputs.upload-artifacts == true }}
7188
uses: ./.github/actions/publish-to-jfrog
7289
with:
7390
crypto-type: ${{ inputs.crypto-type }}
91+
oidc-provider: ${{ secrets.JFROG_OIDC_PROVIDER }}
92+
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}
93+
artifact-name: ${{ steps.get-artifact-name.outputs.artifact-name }}
94+
artifact-id: ${{ steps.get-artifact-id.outputs.artifact-id }}

.github/workflows/promote-prod.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
name: Promot from stage to prod
1717
uses: ./.github/workflows/promote.yaml
1818
with:
19-
build-number: ${{ inputs.build-number }}
20-
target-repository: client-maven-stage-local
19+
build-number: ${{ inputs.build-number }}
20+
target-repository: clients-maven-stage-local
2121
target-branch: dev-stage
22+
secrets: inherit

.github/workflows/promote-to-stage.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,25 @@ jobs:
2020
env:
2121
JF_URL: ${{ vars.JFROG_PLATFORM_URL }}
2222
with:
23-
oidc-provider-name: ${{ inputs.oidc-provider }}
24-
oidc-audience: ${{ inputs.oidc-audience }}
23+
oidc-provider-name: ${{ secrets.JFROG_OIDC_PROVIDER }}
24+
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}
2525

2626
- name: Get info
2727
id: get-build-info
2828
run: |
2929
echo build-info=$(jf rt curl /api/build/clients-java-push-to-dev/${{ inputs.build-number }}) >> $GITHUB_OUTPUT
3030
31+
- name: Get commit hash from repo
32+
id: get-commit-hash
33+
run: |
34+
echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT
35+
36+
- name: Get build name
37+
id: get-build-name
38+
run: |
39+
echo build-name=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.name') >> $GITHUB_OUTPUT
40+
3141
- name: Debug
3242
run: |
33-
echo ${{ steps.get-build-info.outputs.build-info }}
43+
echo "commit-hash: '${{ steps.get-commit-hash.outputs.commit-hash }}'"
44+
echo "build-name: '${{ steps.get-build-name.outputs.build-name }}'"

.github/workflows/promote.yaml

+32-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
build-number:
7-
type: number
7+
type: string
88
description: Build number used to build artifact to be promoted
99
target-repository:
1010
type: string
@@ -25,8 +25,8 @@ jobs:
2525
env:
2626
JF_URL: ${{ vars.JFROG_PLATFORM_URL }}
2727
with:
28-
oidc-provider-name: ${{ inputs.oidc-provider }}
29-
oidc-audience: ${{ inputs.oidc-audience }}
28+
oidc-provider-name: ${{ secrets.JFROG_OIDC_PROVIDER }}
29+
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}
3030

3131
- name: Get info
3232
id: get-build-info
@@ -36,25 +36,43 @@ jobs:
3636
- name: Get commit hash from repo
3737
id: get-commit-hash
3838
run: |
39-
echo commit-hash=$(steps.get-build-info.outputs.build-info | jq -r '.vcs[].revision') >> $GITHUB_OUTPUT
39+
echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT
4040
41-
- name: Get commit hash from repo
41+
- name: Get build name
4242
id: get-build-name
4343
run: |
44-
echo build-name=$(steps.get-build-info.outputs.build-info | jq -r '.name') >> $GITHUB_OUTPUT
44+
echo build-name=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.name') >> $GITHUB_OUTPUT
4545
4646
- name: Debug
4747
run: |
48-
echo ${{ steps.get-build-info.outputs.build-info }}
49-
echo ${{ steps.get-build-info.outputs.build-name }}
48+
echo "commit-hash: '${{ steps.get-commit-hash.outputs.commit-hash }}'"
49+
echo "build-name: '${{ steps.get-build-name.outputs.build-name }}'"
50+
51+
# Needed since we are using actions which are part of the repository
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
with:
55+
# Fetch the whole history to prevent unrelated history errors
56+
fetch-depth: "0"
57+
ref: ${{ inputs.target-branch }}
58+
token: ${{ secrets.CLIENT_BOT_PAT }}
59+
60+
- name: Fast forward
61+
shell: bash
62+
run: git merge --ff-only ${{ inputs.ref-to-merge }}
5063

51-
- name: Merge commit hash from source to target branch
52-
uses: ./github/actions/fast-forward-merge
64+
- name: Add tagging message
65+
uses: stefanzweifel/git-auto-commit-action@v4
5366
with:
54-
ref-to-merge: ${{ steps.get-build-info.outputs.build-info }}
55-
base-branch: ${{ inputs.target-branch }}
56-
git-bot-token: ${{ secrets.CLIENT_BOT_PAT }}
67+
commit_message: "Promote to prod [skip ci]"
68+
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
69+
tagging_message: Promote to PROD
70+
branch: ${{ inputs.target-branch }}
71+
72+
- name: Upload changes to remote head branch
73+
shell: bash
74+
run: git push
5775

5876
- name: Promote build
5977
run: |
60-
jf rt build-promote ${{ steps.get-build-info.outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }}
78+
jf rt build-promote ${{ steps.get-build-name.outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }}

client/pom.xml

+10-11
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<parent>
77
<groupId>com.aerospike</groupId>
88
<artifactId>aerospike-parent</artifactId>
9-
<version>9.0.2</version>
9+
<version>${revision}</version>
1010
</parent>
11-
<artifactId>aerospike-client-jdk21</artifactId>
11+
<artifactId>aerospike-client${crypto.type}-jdk21</artifactId>
1212
<packaging>jar</packaging>
1313

1414
<name>aerospike-client-jdk21</name>
@@ -114,16 +114,16 @@
114114
<phase>install</phase>
115115
<goals>
116116
<goal>install-file</goal>
117-
</goals>
117+
</goals>
118118
<configuration>
119-
<pomFile>${project.basedir}/src/resources/bouncy_pom.xml</pomFile>
119+
<pomFile>${project.basedir}/src/resources/bouncycastle_pom.xml</pomFile>
120120
<file>target/${project.build.finalName}.jar</file>
121121
<groupId>com.aerospike</groupId>
122122
<artifactId>aerospike-client${crypto.type}-jdk21</artifactId>
123-
</configuration>
124-
</execution>
125-
</executions>
126-
</plugin>
123+
</configuration>
124+
</execution>
125+
</executions>
126+
</plugin>
127127
</plugins>
128128
</build>
129129
</profile>
@@ -183,13 +183,13 @@
183183
<phase>install</phase>
184184
<goals>
185185
<goal>install-file</goal>
186-
</goals>
186+
</goals>
187187
<configuration>
188188
<pomFile>${project.basedir}/src/resources/gnu_pom.xml</pomFile>
189189
<file>target/${project.build.finalName}.jar</file>
190190
<groupId>com.aerospike</groupId>
191191
<artifactId>aerospike-client${crypto.type}-jdk21</artifactId>
192-
</configuration>
192+
</configuration>
193193
</execution>
194194
</executions>
195195
</plugin>
@@ -301,7 +301,6 @@
301301
</sourceFileIncludes>
302302
</configuration>
303303
</plugin>
304-
305304
</plugins>
306305

307306
</build>

client/src/resources/bouncy_pom.xml client/src/resources/bouncycastle_pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.aerospike</groupId>
44
<artifactId>aerospike-client-bc-jdk21</artifactId>
5-
<version>9.0.1</version>
5+
<version>9.0.2</version>
66
<packaging>jar</packaging>
77
<name>Aerospike Java Client BC</name>
88
<description>Aerospike Java client interface to Aerospike database server. Uses Bouncy Castle crypto library for RIPEMD-160 hashing.</description>

client/src/resources/gnu_pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.aerospike</groupId>
44
<artifactId>aerospike-client-jdk21</artifactId>
5-
<version>9.0.1</version>
5+
<version>9.0.2</version>
66
<packaging>jar</packaging>
77
<name>Aerospike Java Client</name>
88
<description>Aerospike Java client interface to Aerospike database server</description>

examples/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.aerospike</groupId>
88
<artifactId>aerospike-parent</artifactId>
9-
<version>9.0.2</version>
9+
<version>${revision}</version>
1010
</parent>
1111
<artifactId>aerospike-examples</artifactId>
1212
<packaging>jar</packaging>

0 commit comments

Comments
 (0)