From f94350b73eff59c478897acfe382d1fda67bbd4a Mon Sep 17 00:00:00 2001 From: Cam Walter Date: Sun, 3 Mar 2024 19:53:21 -0600 Subject: [PATCH] GitHub Actions: Include typings.d.ts file This updates the actions and adds back artifact publishing. This also makes it so normal gradle builds do not run the kspKotlin task, as from my experience, slows down build times greatly and disallows hot swapping to debug. If you want to build and run kspKotlin at the same time, just do `gradlew build -Pfull`, or execute each task individually. --- .github/workflows/build.yml | 36 +++++++++++++++++++--------------- .github/workflows/javadocs.yml | 6 +++--- build.gradle.kts | 4 ++++ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0878bf7..d780dc80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,14 +12,14 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -29,16 +29,20 @@ jobs: ${{ runner.os }}-gradle- - name: Build - run: ./gradlew --no-daemon build - - # TODO: Uncomment when we care about publishing artifacts - # - name: Get Short SHA - # id: sha - # run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - # - name: Publish Artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: ChatTriggers-artifacts-${{ steps.sha.outputs.sha_short }} - # path: | - # build/libs/* + run: ./gradlew --no-daemon build -Pfull + + - name: Get Short SHA + id: sha + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Flatten Output Directory + run: | + mkdir temp-dir + cp build/libs/* temp-dir + cp build/generated/ksp/main/resources/* temp-dir + + - name: Publish Artifacts + uses: actions/upload-artifact@v4 + with: + name: ChatTriggers-artifacts-${{ steps.sha.outputs.sha_short }} + path: temp-dir diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml index 326b10ae..6e9648f9 100644 --- a/.github/workflows/javadocs.yml +++ b/.github/workflows/javadocs.yml @@ -13,14 +13,14 @@ jobs: if: github.repository == 'ChatTriggers/ctjs' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: | ~/.gradle/caches diff --git a/build.gradle.kts b/build.gradle.kts index 3fecf30f..cfea7051 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,6 +20,10 @@ plugins { alias(libs.plugins.ksp) } +if (!project.hasProperty("full")) { + project.gradle.startParameter.excludedTaskNames.add("kspKotlin") +} + version = property("mod_version").toString() repositories {