Skip to content

Librarification of the system #6

Librarification of the system

Librarification of the system #6

Workflow file for this run

name: Build and push
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
JFROG_USER: ${{ secrets.ARTIFACTORY_AUTH_USER }}
JFROG_PASS: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }}
SONATYPE_GPG_KEY_BASE64: ${{ secrets.SONATYPE_GPG_KEY_BASE64 }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_GPG_KEY_PASSWORD: ${{ secrets.SONATYPE_GPG_KEY_PASSWORD }}
jobs:
maven-package:
if: "!contains(github.event.head_commit.message, 'ci skip')"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy maven settings
run: |
wget https://raw.githubusercontent.com/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml
- uses: actions/setup-java@v4
with:
java-version: 21.0.5+11
distribution: liberica
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Run maven build
run: mvn package -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -s .github/workflows/settings.xml
- name: Upload artifact
uses: actions/[email protected]
with:
path: target/*.jar
deploy-maven-central:
if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'ci skip')
needs: [maven-package]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy maven settings
run: |
wget https://raw.githubusercontent.com/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml
- uses: actions/setup-java@v4
with:
java-version: 21.0.5+11
distribution: liberica
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Release to Maven Central
run: |
echo "Start release"
echo $SONATYPE_GPG_KEY_BASE64 | base64 --decode | gpg --batch --no-tty --import --yes
git config --global user.email "[email protected]"
git config --global user.name "circleci"
git checkout master
mvn gitflow:release-start gitflow:release-finish \
-DskipTests=true \
-Prelease \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-DpostReleaseGoals=deploy \
-DargLine='-Prelease -DskipTests -s .github/workflows/settings.xml' -B -s .github/workflows/settings.xml