Skip to content

Workflow file for this run

name: Release Library
on:
pull_request:
types: [closed] # Only trigger when a PR is closed
branches:
- main # Only run when PRs are merged into main
jobs:
release:
if: github.event.pull_request.merged == true # Ensure PR was merged
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure Git for Maven
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Perform Maven Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn release:prepare -Darguments="-DskipTests"
mvn release:perform -Darguments="-DskipTests"