diff --git a/.github/workflows/build_1_20_4_v2.yml b/.github/workflows/build_1_20_4_v2.yml index 77c0d21..e1a0806 100644 --- a/.github/workflows/build_1_20_4_v2.yml +++ b/.github/workflows/build_1_20_4_v2.yml @@ -23,38 +23,38 @@ jobs: run: | git config --global user.email "ci@luminolmc.com" git config --global user.name "Luminol CI" - # - name: Apply Patches - # run: ./gradlew applyPatches - # - name: Build - # run: ./gradlew createReobfBundlerJar createReobfPaperclipJar - # - uses: "actions/upload-artifact@v3" - # with: - # name: "Luminol CI Artifacts" - # path: "build/libs/*.jar" - # - name: Rename jar file - # run: | - # mv build/libs/luminol-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-bundler.jar - # mv build/libs/luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar + - name: Apply Patches + run: ./gradlew applyPatches + - name: Build + run: ./gradlew createReobfBundlerJar createReobfPaperclipJar + - uses: "actions/upload-artifact@v3" + with: + name: "Luminol CI Artifacts" + path: "build/libs/*.jar" + - name: Rename jar file + run: | + mv build/libs/luminol-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-bundler.jar + mv build/libs/luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar - name: setenv run: | sh scripts/SetENV.sh echo "${{ env.tag }}" - # - name: Create Release - # if: "!contains(github.event.commits[0].message, '[release-skip]')" - # uses: ncipollo/release-action@v1.12.0 - # with: - # tag: ${{ env.tag }} - # name: Luminol ${{ env.mcversion }} - ${{ env.commitid }} - # body: | - # 📦Version: `${{ env.mcversion }}` | Commit ${{ env.commitid }} [![download](https://img.shields.io/github/downloads/LuminolMC/Luminol/${{ env.tag }}/total?color=0)](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ env.tag }}/luminol-1.20.4-paperclip.jar) - # This release is automatically compiled by GitHub Actions - # artifacts: | - # build/libs/luminol-1.20.4-bundler.jar - # build/libs/luminol-1.20.4-paperclip.jar - # generateReleaseNotes: true - # prerelease: ${{ env.pre }} - # makeLatest: ${{ env.make_latest }} - # token: "${{ secrets.GITHUB_TOKEN }}" + - name: Create Release + if: "!contains(github.event.commits[0].message, '[release-skip]')" + uses: ncipollo/release-action@v1.12.0 + with: + tag: ${{ env.tag }} + name: Luminol ${{ env.mcversion }} - ${{ env.commitid }} + body: | + 📦Version: `${{ env.mcversion }}` | Commit ${{ env.commitid }} [![download](https://img.shields.io/github/downloads/LuminolMC/Luminol/${{ env.tag }}/total?color=0)](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ env.tag }}/luminol-1.20.4-paperclip.jar) + This release is automatically compiled by GitHub Actions + artifacts: | + build/libs/luminol-1.20.4-bundler.jar + build/libs/luminol-1.20.4-paperclip.jar + generateReleaseNotes: true + prerelease: ${{ env.pre }} + makeLatest: ${{ env.make_latest }} + token: "${{ secrets.GITHUB_TOKEN }}" - name: Push to Api if: "!contains(github.event.commits[0].message, '[release-skip]')" env: diff --git a/scripts/PushToAPI.sh b/scripts/PushToAPI.sh index b20313e..0a8918a 100644 --- a/scripts/PushToAPI.sh +++ b/scripts/PushToAPI.sh @@ -5,24 +5,18 @@ sha256() { prop() { grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//' } -echo "$tag" project_id="luminol" mcversion_group=$(prop GroupMCV) mcversion=$(prop mcVersion) -echo "$mcversion_group - $mcversion" pre=$(prop preVersion) if [ $pre = "true" ]; then channel="experimental" else channel="default" fi -git tag changes=$(git log -1 --pretty='[{"commit": "%H", "message": "%s", "summary": "%b"}]') -echo $changes +jar_sha256=`sha256 build/libs/luminol-1.20.4-paperclip.jar` jar_name="luminol-1.20.4-paperclip.jar" -jar_sha256=`sha256 $jar_name` -echo "$jar_sha256" ctime=$(date -u +"%s")"000" -echo "$ctime" # v2 curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" --header "Content-Type: application/json" --header "Authentication: $secret_v2" --data-raw "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}" \ No newline at end of file