Skip to content

Release To Maven Central #101

Release To Maven Central

Release To Maven Central #101

name: Release
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
default: '3.4.2-RC.1'
copyDocsToCurrent:
description: "Should the docs be published at https://docs.spring-boot-admin.com? Otherwise they will be accessible by version number only."
required: true
type: boolean
default: false
env:
VERSION: ${{ github.event.inputs.releaseversion }}
jobs:
publish-central-and-pages:
runs-on: ubuntu-latest
steps:
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"
- name: free disk space
continue-on-error: true
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- uses: actions/checkout@v4
- name: Set up settings.xml for Maven Central Repository
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
cache: 'maven'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress
- name: Publish package
run: mvn -B deploy -X -pl spring-boot-admin-dependencies -DskipTests=true --no-transfer-progress -P central-deploy -DskipTests=true
env:
#TODO: This is a workaround for NEXUS-27902 which uses XStream that fails on JVM >16
JDK_JAVA_OPTIONS: "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED"
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}