From e176f1a76073370e7f870400628471b77d20dd9d Mon Sep 17 00:00:00 2001 From: RezzedUp Date: Sat, 26 Jun 2021 21:44:14 -0500 Subject: [PATCH] Bump version. Update workflows. Cache local maven repositories and test PRs. --- .github/workflows/deploy.yml | 11 ++++++++++- .github/workflows/test-pull-requests.yml | 22 ++++++++++++++++++++++ pom.xml | 23 ++++++++++------------- 3 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test-pull-requests.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 39eb820..809a324 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,8 +1,10 @@ name: Deploy Snapshots and Publish Releases to the Maven Central Repository on: + # Snapshots push: branches: [main] + # Releases release: types: [created] @@ -15,12 +17,19 @@ jobs: with: distribution: 'adopt' java-version: '11' + - name: Cache Local Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- # https://github.com/samuelmeuli/action-maven-publish/issues/20#issuecomment-663544294 - name: Update Version in pom.xml (Release Only) if: github.event.release run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false - name: Release Maven Package - uses: samuelmeuli/action-maven-publish@v1.4.0 + uses: samuelmeuli/action-maven-publish@v1 with: maven_args: -Ddeploy gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} diff --git a/.github/workflows/test-pull-requests.yml b/.github/workflows/test-pull-requests.yml new file mode 100644 index 0000000..7faa7c4 --- /dev/null +++ b/.github/workflows/test-pull-requests.yml @@ -0,0 +1,22 @@ +name: Test Pull Requests + +on: [pull_request] + +jobs: + test-pull-requests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + - name: Cache Local Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build Then Run Tests and Verify + run: mvn -B --update-snapshots verify diff --git a/pom.xml b/pom.xml index 5fa8cf8..fcdac52 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.rezzedup.util constants - 0.0.2-SNAPSHOT + 0.1.0-SNAPSHOT Constants 2021 @@ -114,6 +114,15 @@ + + + + verify + + check + + + @@ -172,18 +181,6 @@ - - - com.mycila - license-maven-plugin - - - - check - - - -