Skip to content

Commit

Permalink
- update GitHub actions
Browse files Browse the repository at this point in the history
- use new `gradle/actions/setup-gradle`
- block cancel-in-progress for publish.yml
  • Loading branch information
aSemy committed Mar 27, 2024
1 parent cc49b5e commit 60ee9b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 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

0 comments on commit 60ee9b9

Please sign in to comment.