Skip to content

Commit

Permalink
[hibernate#1973] Keep GitHub actions configuration consistent between…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
DavideD committed Aug 7, 2024
1 parent 63b8dbe commit 194cebc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
push:
branches:
- main
- 'wip/*'
tags:
- '2.*'
pull_request:
branches:
- main
- 'wip/*'

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

snapshot:
name: Create snapshot only when the branch name starts with `wip/`
if: github.event_name == 'push' && startsWith( github.ref, 'refs/heads/wip/' )
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 snapshots 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

release:
name: Release
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
Expand Down

0 comments on commit 194cebc

Please sign in to comment.