Skip to content

Commit 085622b

Browse files
committed
[#1930] Update GitHub action to build and release snapshots
And print the actual Hibernate ORM version used
1 parent 73a48e5 commit 085622b

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

.github/workflows/build.yml

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
# GitHub actions for branch testing the latest Hibernate ORM 6.5 snapshot
12
name: Hibernate Reactive CI
23

34
on:
45
push:
56
branches:
6-
- main
7-
tags:
8-
- '2.*'
7+
- 'wip/2.3'
98
pull_request:
10-
branches: main
9+
branches:
10+
- 'wip/2.3'
11+
schedule:
12+
# * is a special character in YAML, so you have to quote this string
13+
# Run every hour at minute 25
14+
- cron: '25 * * * *'
15+
# Allow running this workflow against a specific branch/tag
16+
workflow_dispatch:
1117

1218
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
1319
concurrency:
@@ -85,6 +91,8 @@ jobs:
8591
with:
8692
distribution: 'temurin'
8793
java-version: 11
94+
- name: Print the effective ORM version used
95+
run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core
8896
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
8997
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
9098
- name: Upload reports (if build failed)
@@ -122,6 +130,8 @@ jobs:
122130
with:
123131
distribution: 'temurin'
124132
java-version: 11
133+
- name: Print the effective ORM version used
134+
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
125135
- name: Build and Test with ${{ matrix.db }}
126136
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
127137
- name: Upload reports (if build failed)
@@ -200,6 +210,8 @@ jobs:
200210
- name: Display exact version of JDK ${{ matrix.java.name }}
201211
run: |
202212
${{ steps.testjdk-exportpath.outputs.path }}/bin/java -version
213+
- name: Print the effective ORM version used
214+
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
203215
- name: Build and Test with Java ${{ matrix.java.name }}
204216
run: |
205217
./gradlew build -PshowStandardOutput -Pdocker -Ptest.jdk.version=${{ matrix.java.java_version_numeric }} \
@@ -212,37 +224,25 @@ jobs:
212224
name: reports-java${{ matrix.java.name }}
213225
path: './**/build/reports/'
214226

215-
release:
216-
name: Release
217-
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
227+
snapshot:
228+
name: Create snapshot
229+
if: github.event_name == 'push' && startsWith( github.ref, 'refs/heads/' )
218230
runs-on: ubuntu-latest
219231
steps:
220-
- uses: actions/checkout@v2
221-
- name: Set git username and email
222-
run: |
223-
git config --global user.email "[email protected]"
224-
git config --global user.name "hibernate"
225-
- name: Set up JDK 11
226-
uses: actions/[email protected]
227-
with:
228-
distribution: 'temurin'
229-
java-version: 11
230-
- name: Create artifacts
231-
run: ./gradlew assemble
232-
- name: Install SSH key
233-
uses: shimataro/ssh-key-action@v2
234-
with:
235-
key: ${{ secrets.HIBERNATE_ORG_SSH_KEY }}
236-
name: id_rsa_hibernate.org
237-
known_hosts: ${{ secrets.HIBERNATE_ORG_SSH_KNOWN_HOSTS }}
238-
config: |
239-
Host github.com
240-
User hibernate
241-
IdentityFile ~/.ssh/id_rsa_hibernate.org
242-
- name: Publish documentation on Hibernate.org
243-
run: ./gradlew publishDocumentation -PdocPublishBranch=production
244-
- name: Publish artifacts to OSSRH, close repository and release
245-
env:
246-
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
247-
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
248-
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
232+
- uses: actions/checkout@v2
233+
- name: Set up JDK 11
234+
uses: actions/[email protected]
235+
with:
236+
distribution: 'temurin'
237+
java-version: 11
238+
- name: Create artifacts
239+
run: ./gradlew assemble
240+
- name: Detect the version of Hibernate Reactive
241+
id: detect-version
242+
run: |
243+
sed -E 's/^projectVersion( *= *| +)([^ ]+)/::set-output name=version::\2/g' gradle/version.properties
244+
- name: Publish snapshots to OSSRH, close repository and release
245+
env:
246+
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
247+
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
248+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository

0 commit comments

Comments
 (0)