Skip to content

Commit

Permalink
Bump version. Update workflows.
Browse files Browse the repository at this point in the history
Cache local maven repositories and test PRs.
  • Loading branch information
RezzedUp committed Jun 27, 2021
1 parent ca9299d commit e176f1a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Deploy Snapshots and Publish Releases to the Maven Central Repository

on:
# Snapshots
push:
branches: [main]
# Releases
release:
types: [created]

Expand All @@ -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 }}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 10 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.rezzedup.util</groupId>
<artifactId>constants</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.1.0-SNAPSHOT</version>

<name>Constants</name>
<inceptionYear>2021</inceptionYear>
Expand Down Expand Up @@ -114,6 +114,15 @@
</licenseSet>
</licenseSets>
</configuration>
<!-- Check for missing license headers -->
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -172,18 +181,6 @@
</execution>
</executions>
</plugin>
<!-- Check for missing license headers -->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit e176f1a

Please sign in to comment.