From f780e9a95bd57d9de704032418decf0452f960d4 Mon Sep 17 00:00:00 2001 From: KrLite <68179735+KrLite@users.noreply.github.com> Date: Fri, 5 Apr 2024 09:48:28 +0800 Subject: [PATCH] workflows --- .github/workflows/build.yml | 19 ++++++++++++++++--- .github/workflows/release.yml | 12 ++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7a97aa..8fc2947 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Get github short hash + id: github_short_hash + run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -25,8 +28,18 @@ jobs: run: | chmod +x gradlew ./gradlew build - - name: Upload artifacts + - name: Upload artifacts (fabric) uses: actions/upload-artifact@v3 with: - name: Artifacts - path: ${{ github.workspace }}/build/libs \ No newline at end of file + name: Artifacts-fabric + path: ${{ github.workspace }}/fabric/build/libs + - name: Upload artifacts (forge) + uses: actions/upload-artifact@v3 + with: + name: Artifacts-forge + path: ${{ github.workspace }}/forge/build/libs + - name: Upload artifacts (neoforge) + uses: actions/upload-artifact@v3 + with: + name: Artifacts-forge + path: ${{ github.workspace }}/neoforge/build/libs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 123dcb7..1b7232c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,12 @@ name: Publish Release -on: - workflow_dispatch: - release: - types: - - published +on: [ release, workflow_dispatch ] permissions: contents: write jobs: - Build: + Publish: runs-on: ubuntu-latest steps: @@ -27,7 +23,7 @@ jobs: ~/.gradle/caches ~/.gradle/wrapper .gradle - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts*', '**/gradle-wrapper.properties', 'build.gradle.kts') }} + 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 @@ -35,4 +31,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} \ No newline at end of file + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}