Skip to content

Commit 43642b3

Browse files
committed
[#1930] Update GitHub action to build and release snapshots
And print the actual Hibernate ORM version used
1 parent b57ce5a commit 43642b3

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

.github/workflows/build.yml

+29-36
Original file line numberDiff line numberDiff line change
@@ -1,14 +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:
109
branches:
11-
- main
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:
1217

1318
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
1419
concurrency:
@@ -219,37 +224,25 @@ jobs:
219224
name: reports-java${{ matrix.java.name }}
220225
path: './**/build/reports/'
221226

222-
release:
223-
name: Release
224-
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/' )
225230
runs-on: ubuntu-latest
226231
steps:
227-
- uses: actions/checkout@v2
228-
- name: Set git username and email
229-
run: |
230-
git config --global user.email "[email protected]"
231-
git config --global user.name "hibernate"
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: Install SSH key
240-
uses: shimataro/ssh-key-action@v2
241-
with:
242-
key: ${{ secrets.HIBERNATE_ORG_SSH_KEY }}
243-
name: id_rsa_hibernate.org
244-
known_hosts: ${{ secrets.HIBERNATE_ORG_SSH_KNOWN_HOSTS }}
245-
config: |
246-
Host github.com
247-
User hibernate
248-
IdentityFile ~/.ssh/id_rsa_hibernate.org
249-
- name: Publish documentation on Hibernate.org
250-
run: ./gradlew publishDocumentation -PdocPublishBranch=production
251-
- name: Publish artifacts to OSSRH, close repository and release
252-
env:
253-
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
254-
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
255-
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)