Skip to content

Commit 680ffc4

Browse files
authored
Add artifact deployment to workflow_dispatch to keep client and agents in sync (#341)
1 parent debe7fc commit 680ffc4

File tree

12 files changed

+53
-29
lines changed

12 files changed

+53
-29
lines changed

.github/workflows/maven-publish.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
RELEASE_VERSION="${GITHUB_REF##*/}"
6363
RELEASE_VERSION="${RELEASE_VERSION:1}"
6464
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
65+
- name: Update pom with release version
66+
run: |
67+
mvn versions:set -DnewVersion=${{ env.RELEASE_VERSION }}
68+
mvn versions:update-child-modules -Pdse,dse7
6569
6670
# - name: Deploy Artifacts to GitHub Packages
6771
# run: |
@@ -86,39 +90,35 @@ jobs:
8690
- name: Deploy Artifacts to Cloudsmith.io Artifactory
8791
run: |
8892
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
89-
mvn -B clean deploy \
93+
mvn -B deploy \
9094
-P dse,dse7 \
91-
-Drevision="${{ env.RELEASE_VERSION }}" \
9295
-DskipTests \
9396
-DaltDeploymentRepository="${REPO}" \
9497
-DaltSnapshotDeploymentRepository="${REPO}"
9598
9699
# - name: Deploy OpenAPI client to GitHub Packages
97100
# run: |
98101
# REPO="gh::default::https://maven.pkg.github.com/${GITHUB_REPOSITORY}"
99-
# mvn -B clean deploy \
102+
# mvn -B deploy \
100103
# -f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
101-
# -Drevision="${{ env.RELEASE_VERSION }}" \
102104
# -DskipTests \
103105
# -DaltDeploymentRepository="${REPO}" \
104106
# -DaltSnapshotDeploymentRepository="${REPO}"
105107

106108
# - name: Deploy OpenAPI client to Datastax Artifactory
107109
# run: |
108110
# REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
109-
# mvn -B clean deploy \
111+
# mvn -B deploy \
110112
# -f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
111-
# -Drevision="${{ env.RELEASE_VERSION }}" \
112113
# -DskipTests \
113114
# -DaltDeploymentRepository="${REPO}" \
114115
# -DaltSnapshotDeploymentRepository="${REPO}"
115116

116117
- name: Deploy OpenAPI client to Cloudsmith.io Artifactory
117118
run: |
118119
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
119-
mvn -B clean deploy \
120+
mvn -B deploy \
120121
-f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
121-
-Drevision="${{ env.RELEASE_VERSION }}" \
122122
-DskipTests \
123123
-DaltDeploymentRepository="${REPO}" \
124124
-DaltSnapshotDeploymentRepository="${REPO}"
Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
name: Publish OpenAPI Client
22
on:
33
workflow_dispatch:
4-
inputs:
5-
repository:
6-
description: 'Maven Artifact Repository'
7-
required: false
8-
default: 'cloudsmith'
9-
type: choice
10-
options:
11-
- cloudsmith
12-
- datastax
13-
- both
144
jobs:
155
publish-openapi:
166
runs-on: ubuntu-latest
@@ -31,9 +21,10 @@ jobs:
3121
- name: Compute commit SHA
3222
run: |
3323
echo "COMMITSHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
34-
- name: Generate OpenAPI client source
24+
- name: Update release versions
3525
run: |
36-
mvn -B clean process-classes -Drevision="0.1.0-${{ env.COMMITSHA }}"
26+
mvn versions:set -DnewVersion="0.1.0-${{ env.COMMITSHA }}"
27+
mvn versions:update-child-modules -Pdse,dse7
3728
- name: Setup Maven settings.xml
3829
run: |
3930
cat <<EOF > ~/.m2/settings.xml
@@ -44,6 +35,11 @@ jobs:
4435
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
4536
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
4637
</server>
38+
<server>
39+
<id>artifactory</id>
40+
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
41+
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
42+
</server>
4743
<server>
4844
<id>cloudsmith</id>
4945
<username>${{ secrets.CLOUDSMITH_USERNAME }}</username>
@@ -52,23 +48,41 @@ jobs:
5248
</servers>
5349
</settings>
5450
EOF
55-
- name: Compile and deploy OpenAPI client (Datastax Artifactory)
56-
if: ${{ inputs.repository == 'datastax' || inputs.repository == 'both' }}
51+
# Commenting Datastax Artifactory out for now
52+
# - name: Compile and deploy Artifacts (Datastax Artifactory)
53+
# if: ${{ inputs.repository == 'datastax' || inputs.repository == 'both' }}
54+
# run: |
55+
# REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
56+
# mvn -B deploy \
57+
# -P dse,dse7 \
58+
# -DskipTests \
59+
# -DaltDeploymentRepository="${REPO}" \
60+
# -DaltSnapshotDeploymentRepository="${REPO}"
61+
- name: Compile and deploy Artifacts (Cloudsmith.io Artifactory)
62+
if: ${{ inputs.repository == 'cloudsmith' || inputs.repository == 'both' }}
5763
run: |
58-
REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
59-
mvn -B clean deploy \
60-
-f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
61-
-Drevision="0.1.0-${{ env.COMMITSHA }}" \
64+
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
65+
mvn -B deploy \
66+
-P dse,dse7 \
6267
-DskipTests \
6368
-DaltDeploymentRepository="${REPO}" \
6469
-DaltSnapshotDeploymentRepository="${REPO}"
70+
# Commenting Datastax Artifactory out for now
71+
# - name: Compile and deploy OpenAPI client (Datastax Artifactory)
72+
# if: ${{ inputs.repository == 'datastax' || inputs.repository == 'both' }}
73+
# run: |
74+
# REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
75+
# mvn -B deploy \
76+
# -f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
77+
# -DskipTests \
78+
# -DaltDeploymentRepository="${REPO}" \
79+
# -DaltSnapshotDeploymentRepository="${REPO}"
6580
- name: Compile and deploy OpenAPI client (Cloudsmith.io Artifactory)
6681
if: ${{ inputs.repository == 'cloudsmith' || inputs.repository == 'both' }}
6782
run: |
6883
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
69-
mvn -B clean deploy \
84+
mvn -B deploy \
7085
-f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
71-
-Drevision="0.1.0-${{ env.COMMITSHA }}" \
7286
-DskipTests \
7387
-DaltDeploymentRepository="${REPO}" \
7488
-DaltSnapshotDeploymentRepository="${REPO}"

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Changelog for Management API, new PRs should update the `main / unreleased` sect
1010
```
1111

1212
## unreleased
13-
[CHANGE] [#323](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/323) Rename Maven artifact groupId from com.datastax to io.k8ssandra
13+
[CHANGE] [#323](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/323) Rename Maven artifact groupId from com.datastax to io.k8ssandra
1414
[FEATURE] [#323](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/323) Add OpenAPI Java client generation
1515
[FEATURE] [#337](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/337) Publish Maven artifacts to Cloudsmith.io
16+
[BUGFIX] [#339](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/339) OpenAPI client publish does not also publish other artifacts
1617

1718

1819
## Releases older than this point did not maintain a Changelog in the format above. The changes below were generated by the gen_changelog.sh script.

management-api-agent-3.x/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<artifactId>datastax-mgmtapi</artifactId>
1414
<version>${revision}</version>
1515
</parent>
16+
<version>${revision}</version>
1617
<artifactId>datastax-mgmtapi-agent-3.x</artifactId>
1718
<profiles>
1819
<profile>

management-api-agent-4.1.x/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<artifactId>datastax-mgmtapi</artifactId>
1414
<version>${revision}</version>
1515
</parent>
16+
<version>${revision}</version>
1617
<artifactId>datastax-mgmtapi-agent-4.1.x</artifactId>
1718
<properties>
1819
<cassandra4.version>4.1.2</cassandra4.version>

management-api-agent-4.x/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<artifactId>datastax-mgmtapi</artifactId>
1414
<version>${revision}</version>
1515
</parent>
16+
<version>${revision}</version>
1617
<artifactId>datastax-mgmtapi-agent-4.x</artifactId>
1718
<dependencies>
1819
<dependency>

management-api-agent-5.0.x/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<artifactId>datastax-mgmtapi</artifactId>
1414
<version>${revision}</version>
1515
</parent>
16+
<version>${revision}</version>
1617
<artifactId>datastax-mgmtapi-agent-5.0.x</artifactId>
1718
<properties>
1819
<cassandra5.version>5.0-SNAPSHOT</cassandra5.version>

management-api-agent-common/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<artifactId>datastax-mgmtapi</artifactId>
1414
<version>${revision}</version>
1515
</parent>
16+
<version>${revision}</version>
1617
<artifactId>datastax-mgmtapi-agent-common</artifactId>
1718
<profiles>
1819
<profile>

management-api-agent-dse-6.8/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<groupId>io.k8ssandra</groupId>
1313
<version>${revision}</version>
1414
</parent>
15+
<version>${revision}</version>
1516
<modelVersion>4.0.0</modelVersion>
1617
<artifactId>datastax-mgmtapi-agent-dse-6.8</artifactId>
1718
<repositories>

management-api-agent-dse7/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<artifactId>datastax-mgmtapi</artifactId>
1414
<version>${revision}</version>
1515
</parent>
16+
<version>${revision}</version>
1617
<artifactId>datastax-mgmtapi-agent-dse7</artifactId>
1718
<repositories>
1819
<repository>

0 commit comments

Comments
 (0)