Skip to content

Commit

Permalink
Tidy publishing config (#17)
Browse files Browse the repository at this point in the history
* remove custom POM location (Gradle gets confused)

* - update GitHub actions
- use new `gradle/actions/setup-gradle`
- block cancel-in-progress for publish.yml
  • Loading branch information
aSemy authored Mar 27, 2024
1 parent 1ef2045 commit c801a97
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
Expand All @@ -37,17 +37,16 @@ jobs:
java-version: ${{ matrix.java-version }}

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2

- name: Cache Kotlin Konan
id: cache-kotlin-konan
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.konan/**/*
key: kotlin-konan-${{ runner.os }}

- name: Test with Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
arguments: build check --stacktrace -PtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Publish
run: ./gradlew check build --stacktrace -PtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }}
20 changes: 12 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,36 @@ env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGN_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGN_SECRET_PWD }}

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
# Don't cancel midway through publishing if another workflow is triggered, it might cause partial publications
cancel-in-progress: false

jobs:
publish:
runs-on: macos-latest
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m"

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "zulu"
cache: "gradle"

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2

- name: Cache Kotlin Konan
id: cache-kotlin-konan
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.konan/**/*
key: kotlin-konan-${{ runner.os }}

- name: Build
uses: gradle/gradle-build-action@v2
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Publish
run: ./gradlew publish --no-parallel --stacktrace
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ tasks {
val signingRequiredPredicate = provider { signing.isRequired }
onlyIf { signingRequiredPredicate.get() }
}

withType<GenerateMavenPom> {
destination = file("$projectDir/pom.xml")
}
}

// https://youtrack.jetbrains.com/issue/KT-46466
Expand Down

0 comments on commit c801a97

Please sign in to comment.