Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
pgreze committed Jun 27, 2024
1 parent 0af0134 commit c8d9acc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 55 deletions.
14 changes: 14 additions & 0 deletions .github/actions/post-checkout/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Post checkout

description: Post checkout instructions.

runs:
using: "composite"
steps:
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8

- uses: gradle/actions/setup-gradle@v3
42 changes: 12 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# https://help.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-gradle
# https://help.github.com/en/actions/language-and-framework-guides/publishing-java-packages-with-gradle

name: Build

on:
Expand All @@ -15,36 +12,21 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
# Cache
- name: Cache Gradle wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/*') }}
restore-keys: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/*') }}
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
# Build
- name: Build
- uses: actions/checkout@v4

- uses: ./.github/actions/post-checkout

- shell: bash
run: ./gradlew build dokkaHtml --continue

# https://github.com/marketplace/actions/publish-unit-test-results
- name: Publish Unit Test Results
# https://github.com/marketplace/actions/publish-unit-test-results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: build/test-results/**/*.xml
- name: Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
31 changes: 7 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# https://help.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-gradle
# https://help.github.com/en/actions/language-and-framework-guides/publishing-java-packages-with-gradle

name: Publish

on:
Expand All @@ -12,28 +9,13 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
# setup
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
# Cache
- name: Cache Gradle wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/*') }}
restore-keys: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/*') }}
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
# Build + Publish
- name: Build
- uses: actions/checkout@v4

- uses: ./.github/actions/post-checkout

- shell: bash
run: ./gradlew assemble dokkaHtml

- name: Publish to Maven Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand All @@ -45,6 +27,7 @@ jobs:
export SIGNING_SECRET_KEY_RING_FILE=secret-key.gpg
echo $SIGNING_SECRET_KEY_RING_CONTENT | base64 -di > $SIGNING_SECRET_KEY_RING_FILE
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --max-workers 1
- name: Publish Dokka
uses: netlify/actions/cli@master
with:
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import de.fayard.refreshVersions.core.versionFor
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("jvm")
Expand Down

0 comments on commit c8d9acc

Please sign in to comment.