Skip to content

chore(actions): support branch release action #81

chore(actions): support branch release action

chore(actions): support branch release action #81

Workflow file for this run

name: Build
on:
push:
branches:
- develop
- release/*
- support/*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.gpg_private_key }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml, **/target-platform.target') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
MAVEN_USERNAME: ${{ secrets.ossrh_username }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.ossrh_password }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
run: ./mvnw -B -ntp deploy sonar:sonar -Pjacoco