From c10fd188f6dd6220b08bd11ccb407617f451f9d7 Mon Sep 17 00:00:00 2001 From: KrLite <68179735+KrLite@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:30:18 +0800 Subject: [PATCH] update workflows --- .github/workflows/build.yml | 32 ---------------------------- .github/workflows/call_build.yml | 7 ++++++ .github/workflows/call_release.yml | 14 ++++++++++++ .github/workflows/release.yml | 34 ------------------------------ 4 files changed, 21 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/call_build.yml create mode 100644 .github/workflows/call_release.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 907cb00..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build - -on: [ pull_request, push, workflow_dispatch ] - -jobs: - Build: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 - - name: Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - .gradle - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} - - name: Build with Gradle - run: | - chmod +x gradlew - ./gradlew build - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: Artifacts - path: ${{ github.workspace }}/build/libs diff --git a/.github/workflows/call_build.yml b/.github/workflows/call_build.yml new file mode 100644 index 0000000..4e707fe --- /dev/null +++ b/.github/workflows/call_build.yml @@ -0,0 +1,7 @@ +name: Build + +on: [ pull_request, push, workflow_dispatch ] + +jobs: + call-workflow: + uses: KessokuTeaTime/.github/.github/workflows/build.yml@main diff --git a/.github/workflows/call_release.yml b/.github/workflows/call_release.yml new file mode 100644 index 0000000..9cb2cd6 --- /dev/null +++ b/.github/workflows/call_release.yml @@ -0,0 +1,14 @@ +name: Publish Release + +on: + workflow_dispatch: + release: + types: + - published + +permissions: + contents: write + +jobs: + call-workflow: + uses: KessokuTeaTime/.github/.github/workflows/release.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1b7232c..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish Release - -on: [ release, workflow_dispatch ] - -permissions: - contents: write - -jobs: - Publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 20 - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: 20 - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - .gradle - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts*', '**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle.kts', 'build.gradle') }} - - uses: gradle/wrapper-validation-action@v1 - - run: | - chmod +x gradlew - ./gradlew build publishMod --stacktrace -Porg.gradle.parallel.threads=4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}