diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml
similarity index 89%
rename from .github/workflows/build.yml
rename to .github/workflows/build.yaml
index d3d3e25..6363611 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yaml
@@ -1,13 +1,18 @@
-name: Build, test and publish the Quarkus libraries
+name: Build
+
on:
push:
+ branches:
+ - "main"
paths-ignore:
- '.gitattributes'
- '.gitignore'
- '.github/renovate.json5'
+ - '.github/project.yaml'
- 'docs/**'
- 'README.md'
- workflow_dispatch:
+ pull_request:
+
env:
COMMON_MAVEN_OPTS: "-e -B --fae"
@@ -46,6 +51,9 @@ jobs:
- name: Make maven wrapper executable
run: chmod +x mvnw
+ - name: Download dependencies
+ run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline
+
- name: Build and run tests
run: ./mvnw $COMMON_MAVEN_OPTS verify
@@ -56,6 +64,6 @@ jobs:
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
run: ./mvnw $COMMON_MAVEN_OPTS org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=quarkus-commons -Dsonar.projectName='quarkus-commons' -Dsonar.coverage.jacoco.xmlReportPaths=../**/target/jacoco-report/jacoco.xml
- - name: Upload libs to Kvant maven registry
+ - name: Publish jars
if: github.ref == 'refs/heads/main'
run: ./mvnw $COMMON_MAVEN_OPTS deploy -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
\ No newline at end of file
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..b57a2d7
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,70 @@
+name: Release the current version
+
+on:
+ push:
+ branches:
+ - "main"
+ paths:
+ - '.github/project.yaml'
+
+env:
+ COMMON_MAVEN_OPTS: "-e -B --fae"
+
+jobs:
+ release:
+ name: Execute the release
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the code
+ uses: https://github.com/actions/checkout@v4
+
+ - name: Retrieve project metadata
+ uses: https://github.com/radcortez/project-metadata-action@master
+ id: metadata
+ with:
+ metadata-file-path: '.github/project.yaml'
+ local-file: true
+
+ - name: Validate current version
+ if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
+ run: |
+ echo '::error::Cannot release a SNAPSHOT version.'
+ exit 1
+
+ - name: Validate next version
+ if: contains(steps.metadata.outputs.next-version, 'SNAPSHOT') == 'false'
+ run: |
+ echo '::error::Next development version should be a SNAPSHOT version.'
+ exit 1
+
+ - name: Configure SSH and Git
+ env:
+ SSH_DIR: /root/.ssh
+ MAVEN_RELEASE_SSH_KEY: ${{ secrets.MAVEN_RELEASE_SSH_KEY }}
+ run: |
+ mkdir -p ${SSH_DIR}/
+ touch ${SSH_DIR}/known_hosts
+ ssh-keyscan -t rsa -p 2222 git-ssh.kvant.cloud >> ${SSH_DIR}/known_hosts
+ echo "${MAVEN_RELEASE_SSH_KEY}" | base64 -d >> ${SSH_DIR}/id_rsa
+ chmod 600 ${SSH_DIR}/id_rsa
+ git config --global user.name 'maven_release_technical_account'
+ git config --global user.email 'maven-release-bot@phoenix-technologies.ch'
+ git config --global commit.gpgsign true
+ git config --global gpg.format ssh
+ git config --global user.signingkey ${SSH_DIR}/id_rsa
+
+ - name: Set up JDK 21
+ uses: https://github.com/actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+
+ - name: Make maven wrapper executable
+ run: chmod +x mvnw
+
+ - name: Download dependencies
+ run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline
+
+ - name: Prepare release
+ run: ./mvnw $COMMON_MAVEN_OPTS release:prepare
diff --git a/.github/workflows/validate-versions.yaml b/.github/workflows/validate-versions.yaml
new file mode 100644
index 0000000..a44b4c3
--- /dev/null
+++ b/.github/workflows/validate-versions.yaml
@@ -0,0 +1,33 @@
+name: Validate release versions
+
+on:
+ pull_request:
+ paths:
+ - '.github/project.yaml'
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the code
+ uses: https://github.com/actions/checkout@v4
+
+ - name: Retrieve project metadata
+ uses: https://github.com/radcortez/project-metadata-action@master
+ id: metadata
+ with:
+ metadata-file-path: '.github/project.yaml'
+ local-file: true
+
+ - name: Validate current version
+ if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
+ run: |
+ echo '::error::Cannot release a SNAPSHOT version.'
+ exit 1
+
+ - name: Validate next version
+ if: contains(steps.metadata.outputs.next-version, 'SNAPSHOT') == false
+ run: |
+ echo '::error::Next development version should be a SNAPSHOT version.'
+ exit 1
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 5fbe88d..608430b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,6 +29,7 @@
2.50.0
0.8.12
3.2.3
+ 3.1.1
21
@@ -66,6 +67,13 @@
+
+ scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix/quarkus-commons.git
+ scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix/quarkus-commons.git
+ https://git.kvant.cloud/phoenix/quarkus-commons.git
+ HEAD
+
+
io.quarkus
@@ -178,6 +186,18 @@
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ ${release-plugin.version}
+
+ @{project.version}
+ mvnw
+ chore: release @{releaseLabel}
+ chore: prepare for next development iteration [skip ci]
+ true
+
+