Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add artifact deployment to workflow_dispatch to keep client and agents in sync #341

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/maven-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
RELEASE_VERSION="${GITHUB_REF##*/}"
RELEASE_VERSION="${RELEASE_VERSION:1}"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Update pom with release version
run: |
mvn versions:set -DnewVersion=${{ env.RELEASE_VERSION }}
mvn versions:update-child-modules -Pdse,dse7

# - name: Deploy Artifacts to GitHub Packages
# run: |
Expand All @@ -86,39 +90,35 @@ jobs:
- name: Deploy Artifacts to Cloudsmith.io Artifactory
run: |
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
mvn -B clean deploy \
mvn -B deploy \
-P dse,dse7 \
-Drevision="${{ env.RELEASE_VERSION }}" \
-DskipTests \
-DaltDeploymentRepository="${REPO}" \
-DaltSnapshotDeploymentRepository="${REPO}"

# - name: Deploy OpenAPI client to GitHub Packages
# run: |
# REPO="gh::default::https://maven.pkg.github.com/${GITHUB_REPOSITORY}"
# mvn -B clean deploy \
# mvn -B deploy \
# -f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
# -Drevision="${{ env.RELEASE_VERSION }}" \
# -DskipTests \
# -DaltDeploymentRepository="${REPO}" \
# -DaltSnapshotDeploymentRepository="${REPO}"

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

- name: Deploy OpenAPI client to Cloudsmith.io Artifactory
run: |
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
mvn -B clean deploy \
mvn -B deploy \
-f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
-Drevision="${{ env.RELEASE_VERSION }}" \
-DskipTests \
-DaltDeploymentRepository="${REPO}" \
-DaltSnapshotDeploymentRepository="${REPO}"
54 changes: 34 additions & 20 deletions .github/workflows/openapi-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
name: Publish OpenAPI Client
on:
workflow_dispatch:
inputs:
repository:
description: 'Maven Artifact Repository'
required: false
default: 'cloudsmith'
type: choice
options:
- cloudsmith
- datastax
- both
jobs:
publish-openapi:
runs-on: ubuntu-latest
Expand All @@ -31,9 +21,10 @@ jobs:
- name: Compute commit SHA
run: |
echo "COMMITSHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Generate OpenAPI client source
- name: Update release versions
run: |
mvn -B clean process-classes -Drevision="0.1.0-${{ env.COMMITSHA }}"
mvn versions:set -DnewVersion="0.1.0-${{ env.COMMITSHA }}"
mvn versions:update-child-modules -Pdse,dse7
- name: Setup Maven settings.xml
run: |
cat <<EOF > ~/.m2/settings.xml
Expand All @@ -44,6 +35,11 @@ jobs:
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>artifactory</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>cloudsmith</id>
<username>${{ secrets.CLOUDSMITH_USERNAME }}</username>
Expand All @@ -52,23 +48,41 @@ jobs:
</servers>
</settings>
EOF
- name: Compile and deploy OpenAPI client (Datastax Artifactory)
if: ${{ inputs.repository == 'datastax' || inputs.repository == 'both' }}
# Commenting Datastax Artifactory out for now
# - name: Compile and deploy Artifacts (Datastax Artifactory)
# if: ${{ inputs.repository == 'datastax' || inputs.repository == 'both' }}
# run: |
# REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
# mvn -B deploy \
# -P dse,dse7 \
# -DskipTests \
# -DaltDeploymentRepository="${REPO}" \
# -DaltSnapshotDeploymentRepository="${REPO}"
- name: Compile and deploy Artifacts (Cloudsmith.io Artifactory)
if: ${{ inputs.repository == 'cloudsmith' || inputs.repository == 'both' }}
run: |
REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
mvn -B clean deploy \
-f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
-Drevision="0.1.0-${{ env.COMMITSHA }}" \
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
mvn -B deploy \
-P dse,dse7 \
-DskipTests \
-DaltDeploymentRepository="${REPO}" \
-DaltSnapshotDeploymentRepository="${REPO}"
# Commenting Datastax Artifactory out for now
# - name: Compile and deploy OpenAPI client (Datastax Artifactory)
# if: ${{ inputs.repository == 'datastax' || inputs.repository == 'both' }}
# run: |
# REPO="artifactory-releases::default::https://repo.datastax.com/artifactory/datastax-public-releases-local"
# mvn -B deploy \
# -f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
# -DskipTests \
# -DaltDeploymentRepository="${REPO}" \
# -DaltSnapshotDeploymentRepository="${REPO}"
- name: Compile and deploy OpenAPI client (Cloudsmith.io Artifactory)
if: ${{ inputs.repository == 'cloudsmith' || inputs.repository == 'both' }}
run: |
REPO="cloudsmith::default::https://maven.cloudsmith.io/thelastpickle/reaper-mvn/"
mvn -B clean deploy \
mvn -B deploy \
-f management-api-server/target/generated-sources/openapi/java-client/pom.xml \
-Drevision="0.1.0-${{ env.COMMITSHA }}" \
-DskipTests \
-DaltDeploymentRepository="${REPO}" \
-DaltSnapshotDeploymentRepository="${REPO}"
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ Changelog for Management API, new PRs should update the `main / unreleased` sect
```

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


## 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.
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-3.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-3.x</artifactId>
<profiles>
<profile>
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-4.1.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-4.1.x</artifactId>
<properties>
<cassandra4.version>4.1.2</cassandra4.version>
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-4.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-4.x</artifactId>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-5.0.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-5.0.x</artifactId>
<properties>
<cassandra5.version>5.0-SNAPSHOT</cassandra5.version>
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-common</artifactId>
<profiles>
<profile>
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-dse-6.8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<groupId>io.k8ssandra</groupId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<modelVersion>4.0.0</modelVersion>
<artifactId>datastax-mgmtapi-agent-dse-6.8</artifactId>
<repositories>
Expand Down
1 change: 1 addition & 0 deletions management-api-agent-dse7/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-dse7</artifactId>
<repositories>
<repository>
Expand Down
1 change: 1 addition & 0 deletions management-api-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-common</artifactId>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions management-api-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-server</artifactId>
<properties>
<rsapi.version>2.1.1</rsapi.version>
Expand Down
Loading