TraceLog/.github/workflows/check.yml

87 lines
2.7 KiB
YAML

name: CI
on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
check:
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: temurin
java-version: 18
- name: Cache Kotlin/Native compiler
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.toml') }}
- name: Setup Gradle caching
uses: gradle/gradle-build-action@e2097ccd7e8ed48671dc068ac4efa86d25745b39 # v3.3.1
with:
gradle-home-cache-cleanup: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Publish compiler plugin to mavenLocal
run: ./gradlew :compiler-plugin:publishToMavenLocal
- name: Run unit tests
run: ./gradlew check
publish-release:
if: "github.event_name == 'push' && github.event.ref == 'refs/heads/main'"
needs:
- "check"
runs-on: macos-14
permissions:
actions: read
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: temurin
java-version: 18
- name: Cache Kotlin/Native compiler
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.toml') }}
- name: Setup Gradle caching
uses: gradle/gradle-build-action@e2097ccd7e8ed48671dc068ac4efa86d25745b39 # v3.3.1
with:
gradle-home-cache-cleanup: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
dependency-graph: generate-and-submit
- name: Publish to Maven Central
run: ./gradlew -x test -x lint publish :gradle-plugin:publish
env:
SONATYPE_USERNAME: msfjarvis
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.NEXUS_PUBLISH_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets.NEXUS_PUBLISH_SIGNING_KEY_PASSWORD }}