From 9a5a08b117404a5059e284b848c892511152c5d5 Mon Sep 17 00:00:00 2001 From: Felix Seifert Date: Tue, 31 Oct 2023 09:35:31 +0100 Subject: [PATCH 1/3] chore: update `pull_request` workflow --- .github/workflows/pullrequest.yml | 48 ++++++++++++++++++------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 8491858c..4690e084 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -1,29 +1,37 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path - name: maven-build on: - pull_request: - branches: - - master + pull_request: + branches: + - master + paths-ignore: + - '*.md' + - '.gitignore' jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.11 - uses: actions/setup-java@v1 - with: - java-version: 1.11 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: Build - run: mvn -B package --file pom.xml -Pcoverage -Dsytle.colors=always --errors - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: corretto + cache: maven + + - name: Build with Maven + run: > + mvn + --batch-mode + --file pom.xml + -Pcoverage + -Dsytle.colors=always + --errors + package + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 1e00006c9fcda431a5eb91d5bd50d15155a52042 Mon Sep 17 00:00:00 2001 From: Felix Seifert Date: Wed, 1 Nov 2023 10:19:03 +0100 Subject: [PATCH 2/3] chore: update `push` workflow --- .github/workflows/release.yml | 61 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2b73c74..187a2be7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,42 +1,45 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path - name: maven-release on: push: branches: - master + paths-ignore: + - '*.md' + - '.gitignore' jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.11 - uses: actions/setup-java@v1 - with: - java-version: 1.11 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: Publish - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.gpg_private_key }} - gpg_passphrase: ${{ secrets.gpg_passphrase }} - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} - maven_args: '-Pcoverage' + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: corretto + cache: maven + server-id: ossrh # Value of distributionManagement.repository.id field of pom.xml + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + settings-path: ${{ github.workspace }} # Location for settings.xml file + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - name: Publish with Maven deploy + run: > + mvn + --batch-mode + --activate-profiles deploy + -Pcoverage + clean deploy + env: + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} -# - name: Release -# uses: softprops/action-gh-release@v1 -# if: startsWith(github.ref, 'refs/tags/') -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 47a8f8b36acd0f39fe0f5347e8ec68282278d5f3 Mon Sep 17 00:00:00 2001 From: Felix Seifert Date: Mon, 6 Nov 2023 10:57:48 +0100 Subject: [PATCH 3/3] fix: stop ignoring paths for `pullrequest` --- .github/workflows/pullrequest.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 4690e084..9629b092 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -4,9 +4,8 @@ on: pull_request: branches: - master - paths-ignore: - - '*.md' - - '.gitignore' +# Do not execute only for specific paths if workflow is required. +# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks jobs: build: