Skip to content

Deploy OSSRH with environment variables #9

Deploy OSSRH with environment variables

Deploy OSSRH with environment variables #9

Workflow file for this run

# For more information see:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md
name: Java CI with Maven
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Update dependency graph # Improve the quality of Dependabot alerts
uses: advanced-security/[email protected]
deploy:
runs-on: ubuntu-latest
needs: build
if: github.repository_owner == 'alveolo' && github.ref == 'refs/heads/main'
steps:
- uses: actions/[email protected]
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: '22'
distribution: 'temurin'
cache: maven
server-id: 'ossrh'
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: Deploy to Sonatype OSSRH
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: mvn -B deploy --file pom.xml