Skip to content

Commit

Permalink
separate release from build
Browse files Browse the repository at this point in the history
  • Loading branch information
bertramn committed Oct 21, 2023
1 parent 2c4d7fc commit f55d84c
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 70 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/maven-release.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/qodana.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
name: Build and publish to the Maven Central Repository
on:
workflow_dispatch:
release:
types:
- created
push:
branches:
- main
- develop
- releases/**

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup GPG Signing Key
id: gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ vars.GPG_SIGNING_KEY_ID }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
- name: Setup Maven Artifact Signing
uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
cache: maven
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build Package
run: mvn --batch-mode --no-transfer-progress install -Prelease
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# - name: Test with or without coverage
# - name: Store test results
# - name: Check test results
- name: Build Results
uses: actions/upload-artifact@v3
with:
name: maven-distro
retention-days: 1
path: |
target
!target/apidocs/**
!target/classes/**
!target/test-classes/**
!target/maven-archiver/**
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: scan
uses: JetBrains/qodana-action@v2023.2
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Maven Build Artifact
uses: actions/download-artifact@v3
with:
name: maven-distro
- name: Setup Maven Central
uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish Package
run: mvn --batch-mode --no-transfer-progress deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 comments on commit f55d84c

Please sign in to comment.