Skip to content

Commit 194cebc

Browse files
committed
[hibernate#1973] Keep GitHub actions configuration consistent between branches
We keep snapshot releases in separate branches and we need to update the configuration accordingly. Otherwise, we will have 3 different GitHub actions configurations
1 parent 63b8dbe commit 194cebc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/build.yml

+25
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ on:
44
push:
55
branches:
66
- main
7+
- 'wip/*'
78
tags:
89
- '2.*'
910
pull_request:
1011
branches:
1112
- main
13+
- 'wip/*'
1214

1315
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
1416
concurrency:
@@ -219,6 +221,29 @@ jobs:
219221
name: reports-java${{ matrix.java.name }}
220222
path: './**/build/reports/'
221223

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

0 commit comments

Comments
 (0)