diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml deleted file mode 100644 index c06c4a4..0000000 --- a/.github/workflows/maven-release.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: Build and publish to the Maven Central Repository -on: - release: - types: - - created - push: - branches: - - main - - develop - - releases/** - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: echo "gh input version ${{ github.event.inputs.version }}" - - run: echo 'gpg fingerprint ${{ vars.GPG_SIGNING_KEY_ID }}' - - run: echo 'gh actor ${{ env.GITHUB_ACTOR }}' - - 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 - - run: gpg -K --keyid-format LONG --with-keygrip --with-subkey-fingerprint - - run: git config -l --show-origin - - 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 - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - run: cat ~/.m2/settings.xml - - name: Publish Package - run: mvn --batch-mode --no-transfer-progress clean deploy -Prelease - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml deleted file mode 100644 index 9255aec..0000000 --- a/.github/workflows/qodana.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Analyse code quality -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - - develop - -jobs: - qodana: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.2 - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..986bb48 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }}