Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setup-gradle GitHub action #155

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 3 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,10 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'

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

- run: ./gradlew assemble
- run: ./gradlew check

- run: |
set -o xtrace
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then
./gradlew \
-PVERSION_NAME="unspecified" \
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \
publishToMavenLocal
else
./gradlew \
-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
- run: ./gradlew -PRELEASE_SIGNING_ENABLED=false publishToMavenLocal
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
24 changes: 24 additions & 0 deletions .github/workflows/signing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Validate Maven Signing
on:
push:
branches:
- main

jobs:
signing:
if: github.repository_owner == 'JuulLabs'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/actions/setup-gradle@v3

- name: publishToMavenLocal
run: >
./gradlew
-PsigningInMemoryKey='${{ secrets.SIGNING_KEY }}'
-PsigningInMemoryKeyPassword='${{ secrets.SIGNING_PASSWORD }}'
publishToMavenLocal