From 9a820f27db9cfaf0cad0982195b9a3dea5fc90f5 Mon Sep 17 00:00:00 2001 From: LLytho Date: Fri, 26 Jul 2024 15:02:24 +0200 Subject: [PATCH] Update workflows --- .github/stale.yml | 12 --- .github/workflows/build.yml | 60 +++++------- .github/workflows/release.yml | 173 +++++++++------------------------- .github/workflows/support.yml | 9 -- 4 files changed, 69 insertions(+), 185 deletions(-) delete mode 100644 .github/stale.yml delete mode 100644 .github/workflows/support.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index f28cb25..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,12 +0,0 @@ -daysUntilStale: 14 -daysUntilClose: 3 -exemptLabels: - - "state: completed" - - "state: confirmed" - - "state: help wanted/needed" - - "state: in progress" -staleLabel: "type: abandoned" -markComment: > - This submission has been automatically marked as abandoned because it has not had recent activity. It will be closed in 3 days. If you want to prevent that, leave a new comment. -closeComment: > - Due to no recent activity, this submission is closed now. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ddacf2..a570c46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,44 +4,32 @@ on: workflow_dispatch: push: branches: - - '1.20.1' + - "1.21" tags-ignore: - - '**' + - "**" + paths: + - "gradle/**" + - "**.java" + - "**.kts" + - "**.properties" + - "**/build.yml" pull_request: branches: - - '1.20.1' - -env: - JAVA_DIST: 'zulu' - JAVA_VERSION: 17 + - "1.21" + paths: + - "gradle/**" + - "**.java" + - "**.kts" + - "**.properties" + - "**/build.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - build: - name: Build - runs-on: ubuntu-latest - if: | - !contains(github.event.head_commit.message, '[skip build]') - steps: - - name: Clone Repository - uses: actions/checkout@v3 - - - name: Set up JDK ${{ env.JAVA_VERSION }} - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DIST }} - cache: gradle - - - name: Cleanup Gradle Cache - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties - - - name: Make Gradle executable - run: chmod +x ./gradlew - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Build - run: ./gradlew build --stacktrace + redirect: + uses: AlmostReliable/.github/.github/workflows/build.yml@main + with: + java-distribution: "microsoft" + java-version: "21" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd5a0b3..c98fbb9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,133 +2,50 @@ name: Release on: workflow_dispatch: - push: - tags: - - 'v1.20.1-*.*.*' - -env: - JAVA_DIST: 'zulu' - JAVA_VERSION: 17 - MOD_ID: 'morejs' - MOD_NAME: 'MoreJS' + inputs: + target_version: + type: string + required: false + description: "mod version | empty = next option" + update_type: + type: choice + required: false + description: "update type" + default: "minor" + options: + - "major" + - "minor" + - "patch" + - "none" + release_type: + type: choice + required: true + description: "type of release" + default: "release" + options: + - "alpha" + - "beta" + - "release" + debug: + type: boolean + required: false + default: false + description: "enable debug mode (GitHub only)" jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Clone Repository - uses: actions/checkout@v3 - - - name: Set up JDK ${{ env.JAVA_VERSION }} - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DIST }} - cache: gradle - - - name: Cleanup Gradle Cache - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties - - - name: Make Gradle executable - run: chmod +x ./gradlew - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Assemble the JARs - run: ./gradlew assemble - - - name: Move JARs to build directory - run: | - mkdir -p build/libs - mv -f Forge/build/libs/*.jar build/libs - mv -f Fabric/build/libs/*.jar build/libs - - - name: Collect version information - run: | - shopt -s failglob # print a warning if a glob does not match anything - set_var() { - echo $1="$2" - echo $1="$2" >> $GITHUB_ENV - declare -g $1="$2" - } - set_var JAR_FILE $(eval echo build/libs/${{ env.MOD_ID }}-*-*-*.jar) - set_var MINECRAFT_VERSION $(echo ${JAR_FILE%.*} | cut -d- -f3) - set_var MOD_VERSION $(echo ${JAR_FILE%.*} | cut -d- -f4) - set_var RELEASE_TYPE "$(echo ${GITHUB_REF##*/} | cut -d- -f3)" - set_var RELEASE_TYPE "$([[ -z $RELEASE_TYPE ]] && echo release || echo $RELEASE_TYPE)" - - - name: Install changelog parser - uses: taiki-e/install-action@parse-changelog - - - name: Parse changelog - run: parse-changelog CHANGELOG.md ${{ env.MOD_VERSION }} > changes.md - - - name: Release Fabric to CF and MR - uses: Kir-Antipov/mc-publish@v3.3 - with: - curseforge-id: 666198 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - modrinth-id: mo64mR1W - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - files: build/libs/${{ env.MOD_ID }}-fabric-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar - name: ${{ env.MOD_NAME }}-Fabric-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }} - version: ${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}+fabric - version-type: ${{ env.RELEASE_TYPE }} - changelog-file: changes.md - - loaders: fabric - game-versions: ${{ env.MINECRAFT_VERSION }} - version-resolver: exact - java: ${{ env.JAVA_VERSION }} - - curseforge-dependencies: | - kubejs | depends | * - modrinth-dependencies: | - kubejs | depends | * - - retry-attempts: 2 - retry-delay: 10000 - - - name: Release Forge to CF and MR - uses: Kir-Antipov/mc-publish@v3.3 - with: - curseforge-id: 666198 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - modrinth-id: mo64mR1W - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - files: build/libs/${{ env.MOD_ID }}-forge-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar - name: ${{ env.MOD_NAME }}-Forge-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }} - version: ${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}+forge - version-type: ${{ env.RELEASE_TYPE }} - changelog-file: changes.md - - loaders: forge - game-versions: ${{ env.MINECRAFT_VERSION }} - version-resolver: exact - java: ${{ env.JAVA_VERSION }} - - curseforge-dependencies: | - kubejs | depends | * - modrinth-dependencies: | - kubejs | depends | * - - retry-attempts: 2 - retry-delay: 10000 - - - name: Release to GitHub - uses: Kir-Antipov/mc-publish@v3.3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - files: build/libs/${{ env.MOD_ID }}-*-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar - name: v${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }} - version: ${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }} - version-type: ${{ env.RELEASE_TYPE }} - changelog-file: changes.md - retry-attempts: 2 - retry-delay: 10000 + redirect: + uses: AlmostReliable/.github/.github/workflows/release-nf.yml@main + secrets: inherit + with: + java-distribution: "microsoft" + java-version: "21" + mod_name: "MoreJS" + curseforge_id: "666198" + modrinth_id: "mo64mR1W" + dependencies: | + kubejs(required){curseforge:238086}{modrinth:umyGl7zF} + target_version: ${{ github.event.inputs.target_version }} + update_type: ${{ github.event.inputs.update_type }} + release_type: ${{ github.event.inputs.release_type }} + loaders: "neoforge" + debug: ${{ github.event.inputs.debug }} diff --git a/.github/workflows/support.yml b/.github/workflows/support.yml deleted file mode 100644 index dcb2bd1..0000000 --- a/.github/workflows/support.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: "Support Requests" - -on: - issues: - types: [labeled, unlabeled, reopened] - -jobs: - support-requests: - uses: AlmostReliable/.github/.github/workflows/support.yml@main