From b1a181b02f6b0c8b7e8e3bcc085b4ed111d9a55e Mon Sep 17 00:00:00 2001 From: LittleChest <81231195+LittleChest@users.noreply.github.com> Date: Mon, 13 May 2024 00:20:55 +0800 Subject: [PATCH 1/6] [release-skip] Upload to cloud --- .github/workflows/leaves.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/leaves.yml b/.github/workflows/leaves.yml index 77f40c3b..1a9dfe79 100644 --- a/.github/workflows/leaves.yml +++ b/.github/workflows/leaves.yml @@ -1,4 +1,4 @@ -name: Leaves CI +name: Leaves on: push: @@ -8,7 +8,6 @@ on: jobs: build: runs-on: ubuntu-latest - if: github.event.pull_request.merged || github.event_name == 'push' || github.event_name == 'workflow_dispatch' steps: - name: Get repository uses: actions/checkout@v3 @@ -21,8 +20,8 @@ jobs: distribution: 'zulu' - name: Setup Git Config run: | - git config --global user.email "ci@leavesmc.top" - git config --global user.name "Leaves CI" + git config --global user.email "ci@leavesmc.org" + git config --global user.name "LeavesMC CI" - name: Apply Patches uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: @@ -58,6 +57,11 @@ jobs: git push origin HEAD:Leaves - name: Get Release Info run: sh scripts/GetReleaseInfo.sh + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.jar }} + path: ${{ env.jar }} - name: Create Release if: "!contains(github.event.commits[0].message, '[release-skip]')" uses: ncipollo/release-action@v1.12.0 @@ -74,19 +78,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Github Releases To Discord + if: "!contains(github.event.commits[0].message, '[release-skip]')" continue-on-error: true uses: tsickert/discord-webhook@v5.3.0 with: webhook-url: ${{ secrets.DISCORD_WEBHOOK }} raw-data: ${{ env.discordmes }} - - name: Upload Artifact - uses: actions/upload-artifact@v2 + - name: Upload to cloud + if: "!contains(github.event.commits[0].message, '[release-skip]')" + uses: wei/rclone@v1 + env: + RCLONE_CONF: ${{ secrets.RCLONE_CONF }} with: - name: ${{ env.jar }} - path: ${{ env.jar }} - - name: Push to Api - continue-on-error: true + args: copy ${{ env.jar }} FTP:${{ env.tag }} + - name: Push to API if: "!contains(github.event.commits[0].message, '[release-skip]')" + continue-on-error: true env: secret: ${{ secrets.API_PUSH_TOKEN }} secret_v2: ${{ secrets.API_V2_PUSH_TOKEN }} From 0c21efe70d258be631ed35ab1f4876f80671471b Mon Sep 17 00:00:00 2001 From: LittleChest <81231195+LittleChest@users.noreply.github.com> Date: Wed, 22 May 2024 01:20:23 +0800 Subject: [PATCH 2/6] Apply fixes --- .github/workflows/leaves.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/leaves.yml b/.github/workflows/leaves.yml index d00ea8a1..327bd805 100644 --- a/.github/workflows/leaves.yml +++ b/.github/workflows/leaves.yml @@ -70,11 +70,14 @@ jobs: name: ${{ env.jar }} path: ${{ env.jar }} - name: Delete Draft Releases + if: "!contains(github.event.commits[0].message, '[release-skip]')" + continue-on-error: true uses: hugo19941994/delete-draft-releases@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release if: "!contains(github.event.commits[0].message, '[release-skip]')" + continue-on-error: true uses: ncipollo/release-action@v1 with: artifacts: ${{ env.jar }} @@ -85,23 +88,25 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} makeLatest: ${{ env.make_latest }} - name: Github Releases To Discord + if: "!contains(github.event.commits[0].message, '[release-skip]')" continue-on-error: true uses: tsickert/discord-webhook@v6.0.0 with: webhook-url: ${{ secrets.DISCORD_WEBHOOK }} raw-data: ${{ env.discordmes }} - name: Upload to cloud - if: "!contains(github.event.commits[0].message, '[release-skip]')" - uses: wei/rclone@v1 - env: - RCLONE_CONF: ${{ secrets.RCLONE_CONF }} - with: - args: copy ${{ env.jar }} FTP:${{ env.tag }} - - name: Push to API + if: "!contains(github.event.commits[0].message, '[release-skip]')" continue-on-error: true + uses: wei/rclone@v1 + env: + RCLONE_CONF: ${{ secrets.RCLONE_CONF }} + with: + args: copy ${{ env.jar }} FTP:${{ env.tag }} + - name: Push to API if: "!contains(github.event.commits[0].message, '[release-skip]')" + continue-on-error: true env: secret: ${{ secrets.API_PUSH_TOKEN }} secret_v2: ${{ secrets.API_V2_PUSH_TOKEN }} tag: ${{ env.tag }} - run: sh scripts/PushToAPI.sh \ No newline at end of file + run: sh scripts/PushToAPI.sh From 61cb250f42e4179d09eb01a01fce3b1f87fe87e6 Mon Sep 17 00:00:00 2001 From: LittleChest <81231195+LittleChest@users.noreply.github.com> Date: Wed, 22 May 2024 01:21:14 +0800 Subject: [PATCH 3/6] Re apply CI --- .github/workflows/leaves.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/leaves.yml b/.github/workflows/leaves.yml index 327bd805..c55e6b15 100644 --- a/.github/workflows/leaves.yml +++ b/.github/workflows/leaves.yml @@ -1,4 +1,4 @@ -name: Leaves +name: Leaves CI on: push: From 4157f48ceecb23bde46f5f793ee139e65e69c4f9 Mon Sep 17 00:00:00 2001 From: LittleChest <81231195+LittleChest@users.noreply.github.com> Date: Wed, 22 May 2024 01:24:19 +0800 Subject: [PATCH 4/6] Sync test workflow --- .github/workflows/test.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 726b5c89..c41d6a8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,21 +1,11 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - name: Leaves Test CI on: push: - branches-ignore: - - master + branches-ignore: [ master ] pull_request: - types: - - opened - - reopened - - synchronize + workflow_dispatch: + jobs: build: runs-on: ubuntu-latest @@ -38,14 +28,20 @@ jobs: - name: Setup Git Config run: | git config --global user.email "ci@leavesmc.org" - git config --global user.name "Leaves CI" + git config --global user.name "LeavesMC CI" + - name: Get Build Number + run: sh scripts/GetBuildNumber.sh - name: Apply Patches run: ./gradlew applyPatches - - name: Create Paperclip Jar - run: ./gradlew createReobfPaperclipJar + - name: Create Leavesclip Jar + run: ./gradlew createMojmapLeavesclipJar + env: + BUILD_NUMBER: ${{ env.BUILD_NUMBER }} - name: Get Release Info run: sh scripts/GetReleaseInfo.sh - - name: Archive Leaves + env: + BUILD_NUMBER: ${{ env.BUILD_NUMBER }} + - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: ${{ env.jar }} From 413eb3fbabf209c11210637df87006b170d2a864 Mon Sep 17 00:00:00 2001 From: LittleChest <81231195+LittleChest@users.noreply.github.com> Date: Wed, 22 May 2024 01:28:24 +0800 Subject: [PATCH 5/6] Try fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c41d6a8d..06224b3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: git config --global user.email "ci@leavesmc.org" git config --global user.name "LeavesMC CI" - name: Get Build Number - run: sh scripts/GetBuildNumber.sh + run: bash scripts/GetBuildNumber.sh - name: Apply Patches run: ./gradlew applyPatches - name: Create Leavesclip Jar From e616bc433cadc1ed145b9ebaf05b71f5bd765a1d Mon Sep 17 00:00:00 2001 From: LittleChest <81231195+LittleChest@users.noreply.github.com> Date: Wed, 22 May 2024 01:29:35 +0800 Subject: [PATCH 6/6] good let us fix this --- .github/workflows/{leaves.yml => build.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{leaves.yml => build.yml} (98%) diff --git a/.github/workflows/leaves.yml b/.github/workflows/build.yml similarity index 98% rename from .github/workflows/leaves.yml rename to .github/workflows/build.yml index c55e6b15..537b67a7 100644 --- a/.github/workflows/leaves.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: git config --global user.email "ci@leavesmc.org" git config --global user.name "LeavesMC CI" - name: Get Build Number - run: sh scripts/GetBuildNumber.sh + run: bash scripts/GetBuildNumber.sh - name: Apply Patches run: ./gradlew applyPatches - name: Create Leavesclip Jar