Skip to content

Commit

Permalink
Update GitHub actions for wip/2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD committed Jul 31, 2024
1 parent f564716 commit 4a10a61
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 276 deletions.
86 changes: 20 additions & 66 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# GitHub actions for branch testing the latest Hibernate ORM 6.5 snapshot
name: Hibernate Reactive CI

on:
push:
branches:
- main
tags:
- '2.*'
- wip/2.3
pull_request:
branches: main
branches: wip/2.3

# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
concurrency:
Expand All @@ -24,6 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
orm-version: [ '6.5.3-SNAPSHOT' ]
example: [ 'session-example', 'native-sql-example' ]
db: [ 'MySQL', 'PostgreSQL' ]
exclude:
Expand Down Expand Up @@ -85,6 +85,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
- name: Print the effective ORM version used
run: ./gradlew :${{ matrix. }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core \
-PhibernateOrmVersion='${{ matrix.orm-version }}' -PskipOrmVersionParsing -PenableSonatypeOpenSourceSnapshotsRep
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
- name: Upload reports (if build failed)
Expand All @@ -99,6 +102,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
orm-version: [ '6.5.3-SNAPSHOT' ]
db: [ 'MariaDB', 'MySQL', 'PostgreSQL', 'MSSQLServer', 'CockroachDB', 'Db2', 'Oracle' ]
steps:
- uses: actions/checkout@v2
Expand All @@ -122,8 +126,12 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
- name: Print the effective ORM version used
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core \
-PhibernateOrmVersion='${{ matrix.orm-version }}' -PskipOrmVersionParsing -PenableSonatypeOpenSourceSnapshotsRep
- name: Build and Test with ${{ matrix.db }}
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }} \
-PhibernateOrmVersion='${{ matrix.orm-version }}' -PskipOrmVersionParsing -PenableSonatypeOpenSourceSnapshotsRep
- name: Upload reports (if build failed)
uses: actions/upload-artifact@v2
if: failure()
Expand All @@ -137,6 +145,7 @@ jobs:
strategy:
fail-fast: false
matrix:
orm-version: [ '6.5.3-SNAPSHOT' ]
# To list the available "feature versions" on adoptium.net (ignore "tip_version", it's not relevant):
# https://api.adoptium.net/v3/info/available_releases
# To list the available releases for a given "feature version" on adoptium.net (example for 16):
Expand Down Expand Up @@ -200,73 +209,18 @@ jobs:
- name: Display exact version of JDK ${{ matrix.java.name }}
run: |
${{ steps.testjdk-exportpath.outputs.path }}/bin/java -version
- name: Print the effective ORM version used
run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core \
-PhibernateOrmVersion='${{ matrix.orm-version }}' -PskipOrmVersionParsing -PenableSonatypeOpenSourceSnapshotsRep
- name: Build and Test with Java ${{ matrix.java.name }}
run: |
./gradlew build -PshowStandardOutput -Pdocker -Ptest.jdk.version=${{ matrix.java.java_version_numeric }} \
-Porg.gradle.java.installations.paths=${{ steps.mainjdk-exportpath.outputs.path }},${{ steps.testjdk-exportpath.outputs.path }} \
${{ matrix.java.jvm_args && '-Ptest.jdk.launcher.args=' }}${{ matrix.java.jvm_args }}
${{ matrix.java.jvm_args && '-Ptest.jdk.launcher.args=' }}${{ matrix.java.jvm_args }} \
-PhibernateOrmVersion='${{ matrix.orm-version }}' -PskipOrmVersionParsing -PenableSonatypeOpenSourceSnapshotsRep
- name: Upload reports (if build failed)
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-java${{ matrix.java.name }}
path: './**/build/reports/'

snapshot:
name: Create snapshot
if: github.event_name == 'push' && startsWith( github.ref, 'refs/heads/' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 11
- name: Create artifacts
run: ./gradlew assemble
- name: Detect the version of Hibernate Reactive
id: detect-version
run: |
sed -E 's/^projectVersion( *= *| +)([^ ]+)/::set-output name=version::\2/g' gradle/version.properties
- name: Publish snapshot to JBoss Nexus
env:
ORG_GRADLE_PROJECT_jbossNexusUser: ${{ secrets.JBOSS_NEXUS_USER }}
ORG_GRADLE_PROJECT_jbossNexusPassword: ${{ secrets.JBOSS_NEXUS_PASSWORD }}
if: endsWith( steps.detect-version.outputs.version, '-SNAPSHOT' ) && env.ORG_GRADLE_PROJECT_jbossNexusUser
run: ./gradlew publishToJBossNexus closeAndReleaseJBossNexusStagingRepository

release:
name: Release
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set git username and email
run: |
git config --global user.email "[email protected]"
git config --global user.name "hibernate"
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 11
- name: Create artifacts
run: ./gradlew assemble
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.HIBERNATE_ORG_SSH_KEY }}
name: id_rsa_hibernate.org
known_hosts: ${{ secrets.HIBERNATE_ORG_SSH_KNOWN_HOSTS }}
config: |
Host github.com
User hibernate
IdentityFile ~/.ssh/id_rsa_hibernate.org
- name: Publish documentation on Hibernate.org
run: ./gradlew publishDocumentation -PdocPublishBranch=production
- name: Publish artifacts to OSSRH, close repository and release
env:
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
path: './**/build/reports/'
105 changes: 0 additions & 105 deletions .github/workflows/tracking-orm-6.build.yml

This file was deleted.

103 changes: 0 additions & 103 deletions .github/workflows/tracking-vertx-4.build.yml

This file was deleted.

5 changes: 5 additions & 0 deletions examples/native-sql-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ buildscript {
// Useful for local development, it should be disabled otherwise
mavenLocal()
}
// Optional: Enables snapshots repository
// Example: ./gradlew build -PenableSonatypeOpenSourceSnapshotsRep
if ( project.hasProperty('enableSonatypeOpenSourceSnapshotsRep') ) {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
mavenCentral()
}
}
Expand Down
5 changes: 5 additions & 0 deletions examples/session-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ buildscript {
// Useful for local development, it should be disabled otherwise
mavenLocal()
}
// Optional: Enables snapshots repository
// Example: ./gradlew build -PenableSonatypeOpenSourceSnapshotsRep
if ( project.hasProperty('enableSonatypeOpenSourceSnapshotsRep') ) {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
mavenCentral()
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ org.gradle.java.installations.auto-download=false
#db = MSSQL

# Enable the SonatypeOS maven repository (mainly for Vert.x snapshots) when present (value ignored)
#enableSonatypeOpenSourceSnapshotsRep = true
enableSonatypeOpenSourceSnapshotsRep = true

# Enable the maven local repository (for local development when needed) when present (value ignored)
enableMavenLocalRepo = true
#enableMavenLocalRepo = true

# Override default Hibernate ORM version
hibernateOrmVersion = 6.5.3-SNAPSHOT
Expand Down

0 comments on commit 4a10a61

Please sign in to comment.