Skip to content

Commit 469ba8a

Browse files
committed
Integration fixes
1 parent 1a9f6b4 commit 469ba8a

File tree

15 files changed

+199
-88
lines changed

15 files changed

+199
-88
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

+73-12
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,101 @@ 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
32+
artifact-version:
33+
description: ""
34+
required: true
2935

3036
runs:
3137
using: "composite"
3238
steps:
3339
- name: Set up JFrog credentials
40+
id: setup-jfrog-cli
3441
uses: jfrog/setup-jfrog-cli@v4
3542
env:
3643
JF_URL: ${{ inputs.jfrog-platform-url }}
3744
with:
45+
version: 2.72.2
3846
oidc-provider-name: ${{ inputs.oidc-provider }}
3947
oidc-audience: ${{ inputs.oidc-audience }}
4048

41-
- name: Set crypto dependency
49+
- uses: s4u/[email protected]
50+
with:
51+
servers: '[{"id": "jfrog", "username": "${{ steps.setup-jfrog-cli.outputs.oidc-user }}", "password": "${{ steps.setup-jfrog-cli.outputs.oidc-token }}"}]'
52+
53+
- name: Configure jf cli
4254
shell: bash
4355
run: |
44-
./set_crypto ${{ inputs.crypto-type }}
56+
jf mvn-config \
57+
--repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} \
58+
--repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }}
59+
60+
#--exclude-patterns="*client${{ inputs.crypto-type != 'bouncycastle' && '-bc' || '' }}-jdk21*" \
61+
#--include-patterns="*client${{ inputs.crypto-type == 'bouncycastle' && '-bc' || '' }}-jdk21*"
4562
46-
- name: Deploy release
63+
- name: Deploy client release
4764
shell: bash
4865
working-directory: client
4966
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
67+
# jf mvn source:jar javadoc:jar install deploy:deploy-file \
68+
# -DartifactId=${{ inputs.artifact-id }} \
69+
# -DpomFile=src/resources/${{ inputs.crypto-type }}_pom.xml \
70+
# -Dfile=target/${{ inputs.artifact-name }}.jar \
71+
# -Dfiles=target/${{ inputs.artifact-name }}-jar-with-dependencies.jar \
72+
# -Dtypes=jar \
73+
# -Dclassifiers=jar-with-dependencies \
74+
# -Dsources=target/${{ inputs.artifact-name }}-sources.jar \
75+
# -Djavadoc=target/${{ inputs.artifact-name }}-javadoc.jar \
76+
# -DrepositoryId=jfrog \
77+
# -DgeneratePom=false \
78+
# -Durl=${{ inputs.jfrog-platform-url }}/artifactory/${{ inputs.jfrog-releases-repo-name }}
79+
#
80+
# jf mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.3:deploy-file \
81+
# -DartifactId=${{ inputs.artifact-id }} \
82+
# -DpomFile=src/resources/${{ inputs.crypto-type }}_pom.xml \
83+
# -Dfile=target/${{ inputs.artifact-name }}.jar \
84+
# -Dfiles=target/${{ inputs.artifact-name }}-jar-with-dependencies.jar \
85+
# -Dsources=target/${{ inputs.artifact-name }}-sources.jar \
86+
# -Djavadoc=target/${{ inputs.artifact-name }}-javadoc.jar \
87+
# -Dtypes=jar \
88+
# -Dclassifiers=jar-with-dependencies \
89+
# -DrepositoryId=jfrog \
90+
# -DgeneratePom=false \
91+
# -Durl=${{ inputs.jfrog-platform-url }}/artifactory/${{ inputs.jfrog-releases-repo-name }}
92+
jf mvn source:jar javadoc:jar install
93+
94+
- name: Overwrite default pom with public release pom
95+
shell: bash
96+
working-directory: client
97+
run: |
98+
jf rt upload \
99+
src/resources/${{ inputs.crypto-type }}_pom.xml \
100+
my-maven-repo/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/${{ inputs.artifact-name }}.pom \
101+
--build-name=clients-java-push-to-dev \
102+
--build-number=${{ github.run_number }} \
103+
--overwrite=true
104+
105+
- name: Publish build info
106+
shell: bash
107+
run: |
108+
# Collect environment variables for the build
109+
jf rt bce
110+
# Collect VCS details from git and add them to the build
111+
jf rt bag
112+
# Publish build info
113+
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

+29-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,31 @@ 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+
86+
- name: Get artifact version
87+
id: get-artifact-version
88+
working-directory: client
89+
run: |
90+
echo artifact-version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_OUTPUT
91+
6992
- name: Publish to JFrog
7093
if: ${{ !cancelled() && inputs.upload-artifacts == true }}
7194
uses: ./.github/actions/publish-to-jfrog
7295
with:
7396
crypto-type: ${{ inputs.crypto-type }}
97+
oidc-provider: ${{ secrets.JFROG_OIDC_PROVIDER }}
98+
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}
99+
artifact-name: ${{ steps.get-artifact-name.outputs.artifact-name }}
100+
artifact-id: ${{ steps.get-artifact-id.outputs.artifact-id }}
101+
artifact-version: ${{ steps.get-artifact-version.outputs.artifact-version }}

.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 }}

benchmarks/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-benchmarks</artifactId>
1212
<packaging>jar</packaging>

0 commit comments

Comments
 (0)