Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Add publish action along with poolRelease task in Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampflower committed Nov 6, 2022
1 parent eb29768 commit 9d9a98e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish release

on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Build and publish with Gradle
run: ./gradlew poolRelease --no-daemon
- name: Upload build artifacts
uses: AButler/[email protected]
with:
files: 'build/pool/*'
repo-token: ${{secrets.GITHUB_TOKEN}}
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ tasks {
shadowJar {
archiveClassifier.set("")
}
register<Copy>("poolRelease") {
for (proj in subprojects) {
val shadowJar = proj.tasks.findByPath("shadowJar")
if (shadowJar != null) {
from(shadowJar)
}
}
into(project.buildDir.resolve("pool"))
}
}

allprojects {
Expand Down

0 comments on commit 9d9a98e

Please sign in to comment.