Skip to content

Commit 0202c84

Browse files
committed
Integration fixes
1 parent 1a9f6b4 commit 0202c84

File tree

23 files changed

+532
-106
lines changed

23 files changed

+532
-106
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ inputs:
1414
required: false
1515
default: "latest"
1616
description: "Server docker image tag"
17-
jfrog_docker_username:
17+
jfrog-docker-username:
1818
required: true
1919
description: ""
20-
jfrog_docker_token:
20+
jfrog-docker-token:
2121
required: true
2222
description: ""
2323
run-tests:
@@ -28,25 +28,27 @@ inputs:
2828
runs:
2929
using: "composite"
3030
steps:
31+
# Using script to set profile since we would like to have the sticky effect. Set it once and have it
32+
# remain for remainder of the job
3133
- name: Stage crypto
3234
shell: bash
3335
run: |
34-
./set_cypto ${{ inputs.crypto-type }}
36+
./set_crypto ${{ inputs.crypto-type }}
3537
3638
- name: Build
3739
shell: bash
38-
run: mvn clean install -P ${{ inputs.crypto-type }}
40+
run: mvn clean install
3941

4042
- name: Run EE server
4143
if: ${{ inputs.run-tests == 'true' }}
4244
uses: ./.github/actions/run-ee-server
4345
with:
4446
use-server-rc: ${{ inputs.use-server-rc }}
4547
server-tag: ${{ inputs.server-tag }}
46-
docker-hub-username: ${{ inputs.jfrog_docker_username }}
47-
docker-hub-password: ${{ inputs.jfrog_docker_token }}
48+
docker-hub-username: ${{ inputs.jfrog-docker-username }}
49+
docker-hub-password: ${{ inputs.jfrog-docker-token }}
4850

49-
- name: Test
51+
- name: Run tests
5052
shell: bash
5153
if: ${{ inputs.run-tests == true }}
5254
working-directory: test

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

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Create github release
2+
description: Creates a github release
3+
4+
inputs:
5+
artifact-version:
6+
description: ""
7+
required: true
8+
github-token:
9+
description: ""
10+
required: true
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Get previous tag
19+
shell: bash
20+
id: get-prev-tag
21+
run: |
22+
# Fetch all tags
23+
git fetch --tags
24+
echo "previous-tag=$(git tag --sort=-creatordate | sed -n '1p')" >> $GITHUB_OUTPUT
25+
26+
# Extract commit messages between previous tag and the current tag.
27+
- name: Get release notes
28+
shell: bash
29+
id: release-notes
30+
run: |
31+
notes=$(git log "${{ steps.get-previous-tag.outputs.previous-tag }}..HEAD" --pretty=format:"%s" --no-merges)
32+
33+
# GitHub Actions requires that multiline output is escaped:
34+
notes="${notes//'%'/'%25'}"
35+
notes="${notes//$'\n'/'%0A'}"
36+
notes="${notes//$'\r'/'%0D'}"
37+
38+
echo "notes=$notes" >> $GITHUB_OUTPUT
39+
40+
- name: Debug
41+
shell: bash
42+
run: |
43+
echo "artifact-version: ${{ inputs.artifact-version }}"
44+
echo "body: ${{ steps.release-notes.outputs.notes }}"
45+
46+
- uses: rickstaa/action-create-tag@v1
47+
id: "tag_create"
48+
with:
49+
tag: ${{ inputs.artifact-version }}
50+
tag_exists_error: false
51+
message: "Latest release"

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

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,81 @@ 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
35+
deploy-spec-path:
36+
description: ""
37+
required: false
38+
default: deploy-resources
2939

3040
runs:
3141
using: "composite"
3242
steps:
3343
- name: Set up JFrog credentials
44+
id: setup-jfrog-cli
3445
uses: jfrog/setup-jfrog-cli@v4
3546
env:
3647
JF_URL: ${{ inputs.jfrog-platform-url }}
3748
with:
49+
version: 2.72.2
3850
oidc-provider-name: ${{ inputs.oidc-provider }}
3951
oidc-audience: ${{ inputs.oidc-audience }}
4052

41-
- name: Set crypto dependency
53+
- name: Configure jf cli
54+
shell: bash
55+
run: |
56+
jf mvn-config \
57+
--repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} \
58+
--repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }}
59+
60+
- name: Generate deploy spec
4261
shell: bash
62+
working-directory: client
4363
run: |
44-
./set_crypto ${{ inputs.crypto-type }}
64+
jq --arg targetPattern "${{ inputs.jfrog-releases-repo-name }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/" \
65+
--arg publicPomPattern "deploy-resources/${{ inputs.crypto-type }}_pom.xml" \
66+
--arg publicPomTarget "${{ inputs.jfrog-releases-repo-name }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/${{ inputs.artifact-name }}.pom" \
67+
'
68+
.files[0].target = $targetPattern |
69+
.files[1].target = $targetPattern |
70+
.files[2].pattern = $publicPomPattern |
71+
.files[2].target = $publicPomTarget
72+
' ${{ inputs.deploy-spec-path }}/publish-spec.json.template > ${{ inputs.deploy-spec-path }}/publish-spec.json
4573
46-
- name: Deploy release
74+
- name: Debug deploy spec
4775
shell: bash
4876
working-directory: client
4977
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
78+
cat ${{ inputs.deploy-spec-path }}/publish-spec.json
79+
80+
- name: Overwrite default pom with public release pom
81+
shell: bash
82+
working-directory: client
83+
run: |
84+
jf rt upload --spec=${{ inputs.deploy-spec-path }}/publish-spec.json \
85+
--module=${{ inputs.artifact-id }} \
86+
--build-name=clients-java-push-to-dev \
87+
--build-number=${{ github.run_number }}
88+
89+
- name: Debug
90+
shell: bash
91+
run: |
92+
ls -la
93+
ls -laR .jfrog
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish artifacts to Sonatype
2+
description: "Publishes artifacts to Sonatype"
3+
4+
inputs:
5+
jfrog-releases-repo-name:
6+
description: ""
7+
required: false
8+
default: clients-maven-dev-local
9+
jfrog-snapshots-repo-name:
10+
description: ""
11+
required: false
12+
default: clients-maven-dev-local
13+
jfrog-platform-url:
14+
description: ""
15+
required: false
16+
default: https://aerospike.jfrog.io
17+
oidc-provider:
18+
description: ""
19+
required: true
20+
oidc-audience:
21+
description: ""
22+
required: true
23+
artifact-name:
24+
description: ""
25+
required: true
26+
artifact-version:
27+
description: ""
28+
required: true
29+
staging-folder:
30+
description: ""
31+
required: false
32+
default: staging
33+
target-repository:
34+
description: ""
35+
required: false
36+
default: clients-maven-stage-local
37+
38+
runs:
39+
using: "composite"
40+
steps:
41+
- name: Set up JFrog credentials
42+
id: setup-jfrog-cli
43+
uses: jfrog/setup-jfrog-cli@v4
44+
env:
45+
JF_URL: ${{ inputs.jfrog-platform-url }}
46+
with:
47+
version: 2.72.2
48+
oidc-provider-name: ${{ inputs.oidc-provider }}
49+
oidc-audience: ${{ inputs.oidc-audience }}
50+
51+
- name: Create staging folder
52+
shell: bash
53+
run: |
54+
mkdir -p ${{ inputs.staging-folder }}
55+
56+
- name: Download artifacts from JFrog
57+
shell: bash
58+
working-directory: ${{ inputs.staging-folder }}
59+
run: |
60+
jf rt dl "${{ inputs.target-repository }}/com/aerospike/${{ inputs.artifact-name }}/${{ inputs.artifact-version }}/*" .
61+
62+
- name: Debug list downloaded content
63+
shell: bash
64+
working-directory: ${{ inputs.staging-folder }}
65+
run: |
66+
ls -la

.github/workflows/build-dev.yaml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 17 additions & 11 deletions
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
@@ -37,16 +38,16 @@ on:
3738
type: string
3839
required: true
3940
secrets:
40-
GPG_SECRET_KEY:
41+
JFROG_OIDC_PROVIDER:
4142
required: true
42-
GPG_PASS:
43+
JFROG_OIDC_AUDIENCE:
4344
required: true
4445

4546
jobs:
4647
build:
4748
runs-on: ubuntu-latest
4849
steps:
49-
- name: Checkout client
50+
- name: Checkout code
5051
uses: actions/checkout@v4
5152
with:
5253
ref: ${{ inputs.branch }}
@@ -56,18 +57,23 @@ jobs:
5657
with:
5758
distribution: "semeru" # See 'Supported distributions' for available options
5859
java-version: ${{ inputs.java-version }}
59-
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
60-
gpg-passphrase: ${{ secrets.GPG_PASS }}
60+
61+
# This is needed so we can authenticate and get the credentials to be able to pull AE RC from JFrog
62+
- name: Set up JFrog credentials
63+
id: setup-jfrog-cli
64+
uses: jfrog/setup-jfrog-cli@v4
65+
env:
66+
JF_URL: ${{ inputs.jfrog-platform-url }}
67+
with:
68+
version: 2.72.2
69+
oidc-provider-name: ${{ inputs.oidc-provider }}
70+
oidc-audience: ${{ inputs.oidc-audience }}
6171

6272
- name: Build and test
6373
uses: ./.github/actions/build-and-test
6474
with:
6575
crypto-type: ${{ inputs.crypto-type }}
6676
server-tag: ${{ inputs.server-tag }}
6777
use-server-rc: ${{ inputs.use-server-rc }}
68-
69-
- name: Publish to JFrog
70-
if: ${{ !cancelled() && inputs.upload-artifacts == true }}
71-
uses: ./.github/actions/publish-to-jfrog
72-
with:
73-
crypto-type: ${{ inputs.crypto-type }}
78+
jfrog-docker-username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
79+
jfrog-docker-token: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}

.github/workflows/promote-prod.yaml

Lines changed: 3 additions & 2 deletions
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

0 commit comments

Comments
 (0)