Skip to content
119 changes: 119 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Create a new release

on:
workflow_dispatch:
inputs:
tag-name:
description: 'New tag for release. Example: v0.5.2'
required: true
from-tag-name:
description: 'Previous tag to compare for release notes generation. Example: v0.5.1 Default value: latest tag.'
required: false

jobs:
create-release:
permissions:
contents: write
pull-requests: read
issues: read
runs-on: ubuntu-latest
environment: publish
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0 # Fetch all history for all tags and branches

- uses: actions/setup-python@v6
with:
python-version: '3.14'

- name: Check format of received tag
id: check-version-tag
uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 # v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github-repository: ${{ github.repository }}
version-tag: ${{ github.event.inputs.tag-name }}

- name: Check format of received from tag
if: ${{ github.event.inputs.from-tag-name }}
id: check-version-from-tag
uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 # v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github-repository: ${{ github.repository }}
version-tag: ${{ github.event.inputs.from-tag-name }}
should-exist: true

- name: Define semantic version number
id: semantic_version
run: |
TAG_NAME="${{ github.event.inputs.tag-name }}"
VERSION=${TAG_NAME#v}
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"

- name: Configure Git
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}

- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: 17

- name: Set Maven project version, create tag
run: |
mvn versions:set -DnewVersion=${VERSION} --no-transfer-progress
mvn versions:commit
git commit -am "Set project version to ${VERSION}"
git push
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Create tag
run: |
git tag ${{ github.event.inputs.tag-name }}
git push origin ${{ github.event.inputs.tag-name }}

- name: Set next development version
run: |
# Assumes semantic versioning and increments the minor version. Adjust the awk command as needed for different versioning schemes.
NEXT_VERSION=$(echo ${VERSION} | awk -F. '{print $1"."$2+1".0-SNAPSHOT"}')
mvn versions:set -DnewVersion=$NEXT_VERSION --no-transfer-progress
mvn versions:commit
git commit -am "Set project version to $NEXT_VERSION"
git push

- name: Generate Release Notes
id: generate_release_notes
uses: AbsaOSS/generate-release-notes@b4d6e3fafcff2dedc32ec751975fa3d0b3efad67 # v1.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag-name: ${{ github.event.inputs.tag-name }}
from-tag-name: ${{ github.event.inputs.from-tag-name }}
hierarchy: true
chapters: |
- { title: Breaking Changes 💥, labels: breaking-change }
- { title: New Features 🎉, labels: enhancement }
- { title: Bugfixes 🛠, labels: [bug, bugfix] }
- { title: Other Changes, labels: [improvement, internal, chore] }
- { title: Silent Live 🤫, catch-open-hierarchy: true}
warnings: true
print-empty-chapters: false

- name: Create Draft Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ABRiS ${{ env.VERSION}}
body: ${{ steps.generate_release_notes.outputs.release-notes }}
tag_name: ${{ github.event.inputs.tag-name }}
draft: true
prerelease: false
77 changes: 77 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#
# Copyright 2018 ABSA Group Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Deploy

on:
workflow_dispatch:

jobs:
deploy:
permissions:
contents: read
pull-requests: read
issues: read
runs-on: ubuntu-latest
environment: publish
steps:
- name: Validate ref is a tag
if: github.ref_type != 'tag'
run: |
echo "This workflow must run from a tag."
exit 1

- name: Checkout repository
uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Check format of received tag
id: check-version-tag
uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 # v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github-repository: ${{ github.repository }}
version-tag: ${{ github.ref_name }}
should-exist: 'true'

- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: 17

- name: Import GPG keys
run: |
echo "${{ secrets.PGP_SECRET }}" | base64 --decode | gpg --batch --import

- name: Create settings.xml
run: |
echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd\">
<servers>
<server>
<id>central</id>
<username>${{ secrets.SONATYPE_USERNAME }}</username>
<password>${{ secrets.SONATYPE_PASSWORD }}</password>
</server>
</servers>
</settings>" > $HOME/.m2/settings.xml

- name: Build and deploy artifact
env:
GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: mvn -B -e -DskipTests -Pdeploy clean deploy
81 changes: 21 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
<!--Maven-->
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.sources.version>3.0.1</maven.sources.version>
<gpg.plugin.version>1.6</gpg.plugin.version>
<surefire.version>3.0.0-M1</surefire.version>
<nexus.staging.plugin.version>1.6.8</nexus.staging.plugin.version>
<maven.shade.plugin.version>3.2.1</maven.shade.plugin.version>
<maven.sources.version>3.4.0</maven.sources.version>
<gpg.plugin.version>3.2.8</gpg.plugin.version>
<surefire.version>3.5.6</surefire.version>
<central.publishing.maven.plugin.version>0.11.0</central.publishing.maven.plugin.version>
<maven.shade.plugin.version>3.6.2</maven.shade.plugin.version>

<!-- Spark -->
<spark.default.version>4.2.0</spark.default.version>
Expand All @@ -66,25 +66,20 @@
<confluent.version>8.3.1</confluent.version>

<!--Libs-->
<jacoco.version>0.8.10</jacoco.version>
<jacoco.version>0.8.11</jacoco.version>

<!--Tests-->
<scalatestplus.mockito.version>3.2.19.0</scalatestplus.mockito.version>
<scalatest.version>3.2.20</scalatest.version>
<scalatest.maven.plugin.version>2.2.0</scalatest.maven.plugin.version>

<scala.maven.plugin.version>4.9.10</scala.maven.plugin.version>

<scm.url><!-- defined outside the pom --></scm.url>
<scm.connection><!-- defined outside the pom --></scm.connection>
<scm.developerConnection><!-- defined outside the pom --></scm.developerConnection>
</properties>

<scm>
<url>${scm.url}</url>
<connection>${scm.connection}</connection>
<developerConnection>${scm.developerConnection}</developerConnection>
<tag>HEAD</tag>
<connection>scm:git:https://github.com/absaoss/abris.git</connection>
<developerConnection>scm:git:ssh://github.com:absaoss/abris.git</developerConnection>
<url>https://github.com/AbsaOSS/ABRiS</url>
</scm>

<licenses>
Expand Down Expand Up @@ -294,7 +289,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.1</version>
<configuration>
<excludes>
<exclude>log4j.properties</exclude>
Expand Down Expand Up @@ -328,7 +323,7 @@
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.9.2</version>
<version>${avro.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand Down Expand Up @@ -422,6 +417,7 @@
</execution>
</executions>
<configuration>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand All @@ -430,51 +426,16 @@
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus.staging.plugin.version}</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central.publishing.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<autoDropAfterRelease>true</autoDropAfterRelease>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id> <!-- increment version and create release commits -->
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<providerImplementations>
<git>jgit</git>
</providerImplementations>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
<deploymentName>${pom.groupId}:${pom.artifactId}:${project.version}</deploymentName>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jgit</artifactId>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.5.1.201910021850-r</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand All @@ -487,7 +448,7 @@
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.13</version>
<version>0.18</version>
<executions>
<execution>
<phase>validate</phase>
Expand Down Expand Up @@ -519,7 +480,7 @@
<plugin>
<groupId>org.spurint.maven.plugins</groupId>
<artifactId>mima-maven-plugin</artifactId>
<version>0.8.0</version>
<version>0.9.2</version>
<executions>
<execution>
<id>check-abi</id>
Expand Down
Loading