fix: configure auto-merge #2432
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-release-on-main-push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-release-on-main-push: | |
if: ${{ !contains(github.event.head_commit.message, '[release]') }} # prevent recursive releases | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
token: ${{secrets.PAT_GH_CI}} | |
- name: setup-jdk | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
cache: maven | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: maven-build-verify | |
run: mvn --batch-mode verify | |
- uses: qoomon/actions--setup-git@v1 | |
with: | |
user: actor | |
- name: publish-on-maven-central | |
run: mvn --batch-mode -P osslabz-release clean release:clean release:prepare release:perform | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | |
- name: merge-main-to-dev | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
target_branch: dev | |
message: "[release] merge released main back to dev" | |
github_token: $${{secrets.PAT_GH_CI}} |