Skip to content

Commit

Permalink
Add build, release and unit test workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
Reid Buzby authored and reidbuzby committed Oct 26, 2023
1 parent 7c4b0aa commit ac44aca
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Gradle Build
on:
push:
branches:
- main
pull_request:

jobs:
gradle:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: ['8', '11', '17']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'

- name: Build Library
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 5
command: |
./gradlew build
- name: Publish to Maven Local
run: ./gradlew publishToMavenLocal
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
tags:
- v**

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: publish-to-maven-central
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
20 changes: 20 additions & 0 deletions .github/workflows/tests-unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: tests-unit

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Run tests
run: ./gradlew check

0 comments on commit ac44aca

Please sign in to comment.