Skip to content

Commit

Permalink
fix: release to maven central (wrong copy :))
Browse files Browse the repository at this point in the history
  • Loading branch information
melistik committed Mar 14, 2023
1 parent 57bbc0c commit df230a6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 33 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/release-action.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: release-to-maven-central
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
default: '1.0.0'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- run: |
echo "Release version ${{ github.event.inputs.releaseversion }}!"
- uses: actions/checkout@v2

- name: Set up Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"

- name: Publish package
run: mvn --batch-mode clean deploy -P release -DskipTests=true
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.releaseversion }}
release_name: ${{ github.event.inputs.releaseversion }}
body: |
New version ${{ github.event.inputs.releaseversion }} published
draft: false
prerelease: false

0 comments on commit df230a6

Please sign in to comment.