Skip to content

Commit

Permalink
Create maven-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Aug 17, 2024
1 parent 9d3966f commit 9ece64e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Maven Publish

on:
push:
branches: [ 'release-1.x' ]
workflow_dispatch:
inputs:
revision:
description: 'The version to publish'
required: true
default: '0.0.1-SNAPSHOT'

jobs:
build:
runs-on: ubuntu-latest
if: ${{ inputs.revision }}
steps:
- name: Checkout Source
uses: actions/checkout@v4

- name: Setup Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
cache: maven

- name: Publish package
run: mvn --batch-mode --update-snapshots -Drevision=${{ inputs.revision }} -Dgpg.skip=true -Prelease,ci clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
SIGN_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID_LONG }}
SIGN_KEY: ${{ secrets.OSS_SIGNING_KEY }}
SIGN_KEY_PASS: ${{ secrets.OSS_SIGNING_PASSWORD }}

0 comments on commit 9ece64e

Please sign in to comment.