Skip to content

Commit

Permalink
Use setup-gradle GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt committed May 19, 2024
1 parent 8b4993a commit e86d13c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 37 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- uses: gradle/actions/setup-gradle@v3

- run: ./gradlew assemble
- run: ./gradlew check
Expand All @@ -29,17 +20,13 @@ jobs:
set -o xtrace
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then
./gradlew \
-PVERSION_NAME="unspecified" \
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \
-PVERSION_NAME=unspecified \
-PsigningInMemoryKey='${{ secrets.SIGNING_KEY }}' \
-PsigningInMemoryKeyPassword='${{ secrets.SIGNING_PASSWORD }}' \
publishToMavenLocal
else
./gradlew \
-PVERSION_NAME="unspecified-SNAPSHOT" \
-PVERSION_NAME=unspecified-SNAPSHOT \
publishToMavenLocal
fi
if: ${{ github.repository_owner == 'JuulLabs' }}
- run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
6 changes: 6 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- uses: gradle/actions/setup-gradle@v3

- run: ./gradlew dokkaHtmlMultiModule
- uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,14 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-publish-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-publish-
${{ runner.os }}-
- uses: gradle/actions/setup-gradle@v3

- run: ./gradlew check
- run: >-
./gradlew
-PVERSION_NAME="${GITHUB_REF/refs\/tags\//}"
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}"
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}"
-PmavenCentralUsername="${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}"
-PmavenCentralPassword="${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}"
-PVERSION_NAME='${{ github.ref_name }}'
-PsigningInMemoryKey='${{ secrets.SIGNING_KEY }}'
-PsigningInMemoryKeyPassword='${{ secrets.SIGNING_PASSWORD }}'
-PmavenCentralUsername='${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}'
-PmavenCentralPassword='${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}'
publish
- run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties

0 comments on commit e86d13c

Please sign in to comment.