Skip to content

Logback Appender Maven CI #82

Logback Appender Maven CI

Logback Appender Maven CI #82

name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MVN_MASTER_PASSWORD: ${{ secrets.MVN_MASTER_PASSWORD }}
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: 11
- name: Create settings-security.xml
run: |
echo '<settingsSecurity>' > ~/.m2/settings-security.xml
echo " <master>${{ secrets.MVN_MASTER_PASSWORD }}</master>" >> ~/.m2/settings-security.xml
echo '</settingsSecurity>' >> ~/.m2/settings-security.xml
- name: Release Maven package
uses: samuelmeuli/[email protected]
with:
maven_profiles: deploy, verify
gpg_private_key: ${{ secrets.GPG_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USERNAME }}
nexus_password: ${{ secrets.OSSRH_PASSWORD }}
server_id: ossrh-nexus
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Apache Maven Central
# uses: actions/setup-java@v3
# with: # running setup-java again overwrites the settings.xml
# java-version: 11
# distribution: 'temurin'
# cache: 'maven'
# server-id: ossrh-nexus # Value of the distributionManagement/repository/id field of the pom.xml
# server-username: OSSRH_USERNAME # env variable for username in deploy
# server-password: OSSRH_TOKEN # env variable for token in deploy
# gpg-private-key: ${{ secrets.GPG_KEY }} # Value of the GPG private key to import
# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
# - name: Create settings-security.xml
# run: |
# echo '<settingsSecurity>' > ~/.m2/settings-security.xml
# echo " <master>${{ secrets.MVN_MASTER_PASSWORD }}</master>" >> ~/.m2/settings-security.xml
# echo '</settingsSecurity>' >> ~/.m2/settings-security.xml
# - name: Publish to Apache Maven Central
# run: mvn deploy -Dmaven.test.skip=true -e
# env:
# OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# build:
# runs-on: ubuntu-latest
# env:
# OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
# GPG_KEY: ${{ secrets.GPG_KEY }}
# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# MVN_MASTER_PASSWORD: ${{ secrets.MVN_MASTER_PASSWORD }}
# steps:
# - uses: actions/checkout@v2
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# java-version: 11
# distribution: 'adopt'
# - name: Cache Maven packages
# uses: actions/cache@v2
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2
# - name: Install dependencies
# run: ./mvnw install -DskipTests -Dgpg.skip
# - name: Build and Test
# if: github.event_name != 'release'
# run: echo 'Install on ${{ github.ref }}'
# deploy:
# if: github.event_name == 'release'
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# java-version: 11
# distribution: 'adopt'
# - name: Set project version
# run: ./mvnw versions:set -DnewVersion=${{ github.ref }}
# - name: Deploy
# run: bash ./mvnw deploy --settings release/settings.xml -DskipTests
# - name: Post-deployment step
# run: echo 'Deployed finished successfully'