Skip to content

Commit bac90ce

Browse files
committed
[#1930] Update GitHub action to build and release snapshots
1 parent 08599de commit bac90ce

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

.github/workflows/build.yml

+35-36
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
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: wip/2.3
10+
schedule:
11+
# * is a special character in YAML, so you have to quote this string
12+
# Run every hour at minute 25
13+
- cron: '25 * * * *'
14+
# Allow running this workflow against a specific branch/tag
15+
workflow_dispatch:
1116

1217
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
1318
concurrency:
@@ -85,6 +90,8 @@ jobs:
8590
with:
8691
distribution: 'temurin'
8792
java-version: 11
93+
- name: Print the effective ORM version used
94+
run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core
8895
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
8996
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
9097
- name: Upload reports (if build failed)
@@ -122,6 +129,8 @@ jobs:
122129
with:
123130
distribution: 'temurin'
124131
java-version: 11
132+
- name: Print the effective ORM version used
133+
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
125134
- name: Build and Test with ${{ matrix.db }}
126135
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
127136
- name: Upload reports (if build failed)
@@ -200,6 +209,8 @@ jobs:
200209
- name: Display exact version of JDK ${{ matrix.java.name }}
201210
run: |
202211
${{ steps.testjdk-exportpath.outputs.path }}/bin/java -version
212+
- name: Print the effective ORM version used
213+
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
203214
- name: Build and Test with Java ${{ matrix.java.name }}
204215
run: |
205216
./gradlew build -PshowStandardOutput -Pdocker -Ptest.jdk.version=${{ matrix.java.java_version_numeric }} \
@@ -212,37 +223,25 @@ jobs:
212223
name: reports-java${{ matrix.java.name }}
213224
path: './**/build/reports/'
214225

215-
release:
216-
name: Release
217-
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
226+
snapshot:
227+
name: Create snapshot
228+
if: github.event_name == 'push' && startsWith( github.ref, 'refs/heads/' )
218229
runs-on: ubuntu-latest
219230
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
231+
- uses: actions/checkout@v2
232+
- name: Set up JDK 11
233+
uses: actions/[email protected]
234+
with:
235+
distribution: 'temurin'
236+
java-version: 11
237+
- name: Create artifacts
238+
run: ./gradlew assemble
239+
- name: Detect the version of Hibernate Reactive
240+
id: detect-version
241+
run: |
242+
sed -E 's/^projectVersion( *= *| +)([^ ]+)/::set-output name=version::\2/g' gradle/version.properties
243+
- name: Publish snapshots to OSSRH, close repository and release
244+
env:
245+
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
246+
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
247+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository

0 commit comments

Comments
 (0)