diff --git a/.github/workflows/develop.yml b/.github/workflows/beta.yml similarity index 79% rename from .github/workflows/develop.yml rename to .github/workflows/beta.yml index 332c4be..10438cf 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/beta.yml @@ -1,9 +1,8 @@ -name: develop +name: beta on: push: branches: - '14-develop' - - '15-develop' jobs: build: @@ -28,10 +27,9 @@ jobs: name: Publish run: | export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA) - # ./gradlew upload --info --stacktrace - # ./gradlew publishGprPublicationToGitHubPackagesRepository + ./gradlew uploadBeta --info --stacktrace - uses: actions/upload-artifact@v3 with: - name: develop-build + name: CustomSkinLoader-Beta-${{ GITHUB_RUN_NUMBER }} path: build/libs \ No newline at end of file diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml new file mode 100644 index 0000000..ce3db4a --- /dev/null +++ b/.github/workflows/canary.yml @@ -0,0 +1,35 @@ +name: canary +on: + push: + branches: + - '15-develop' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + cache: 'gradle' + - + name: Build + run: | + export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA) + ./gradlew clean build --stacktrace + - + name: Publish + run: | + export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA) + ./gradlew uploadCanary --info --stacktrace + - + uses: actions/upload-artifact@v3 + with: + name: CustomSkinLoader-Canary-${{ GITHUB_RUN_NUMBER }} + path: build/libs \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4998e5e..f489d84 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,5 +32,5 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: release-build + name: CustomSkinLoader-Beta-${{ GITHUB_RUN_NUMBER }} path: build/libs \ No newline at end of file diff --git a/README.md b/README.md index e99c446..6235d11 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,17 @@ Custom Skin Loader mod for Minecraft. It's a mod which can load skins and capes from any online source or from your local. ## Download -Latest version could be found in [CurseForge](https://minecraft.curseforge.com/projects/customskinloader) or [Modrinth](https://modrinth.com/mod/customskinloader). -中文用户也可以从[33 Kit](https://3-3.dev/csl-download)获取最新版本。 +### Release Build +- [CurseForge](https://minecraft.curseforge.com/projects/customskinloader) +- [Modrinth](https://modrinth.com/mod/customskinloader) +- [33 Kit(Chinese/中文)](https://3-3.dev/csl-download) -Build Server : [CircleCI](https://circleci.com/gh/xfl03/MCCustomSkinLoader) & ~~[Infinity Studio CI](https://ci.infstudio.net/job/CustomSkinLoader/)~~ -Release Page : [MCBBS](http://www.mcbbs.net/thread-269807-1-1.html) & [GitHub](https://github.com/xfl03/MCCustomSkinLoader/releases) & [CurseForge](https://minecraft.curseforge.com/projects/customskinloader) & [Modrinth](https://modrinth.com/mod/customskinloader) & [33 Kit](https://3-3.dev/csl-download) +### Develop Build +- [GitHub Action](https://github.com/xfl03/MCCustomSkinLoader/actions) ## Contact Us -[QQ Group](https://im.qq.com/): [651287593](https://jq.qq.com/?_wv=1027&k=vF16R5tg) -[Telegram](https://telegram.org/): [@customskinloader](https://t.me/customskinloader) +- [Telegram](https://telegram.org/): [@customskinloader](https://t.me/customskinloader) +- [QQ Group(Chinese/中文)](https://im.qq.com/): [651287593](https://jq.qq.com/?_wv=1027&k=vF16R5tg) ## Feature ### Support Plenty of Skin Load API and Customizable Skin Load List diff --git a/buildSrc/src/main/java/customskinloader/gradle/task/UploadTask.java b/buildSrc/src/main/java/customskinloader/gradle/task/UploadTask.java index 717efbf..38f64b6 100644 --- a/buildSrc/src/main/java/customskinloader/gradle/task/UploadTask.java +++ b/buildSrc/src/main/java/customskinloader/gradle/task/UploadTask.java @@ -3,8 +3,6 @@ package customskinloader.gradle.task; import java.io.File; import java.io.IOException; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.tencentcloudapi.common.exception.TencentCloudSDKException; import customskinloader.gradle.entity.CslDetail; import customskinloader.gradle.entity.CslLatest; @@ -19,9 +17,7 @@ import org.gradle.api.tasks.TaskAction; public class UploadTask extends DefaultTask { public Project rootProject; - private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - private CslLatest uploadArtifacts() throws IOException { + private CslLatest uploadArtifacts(String filename) throws IOException { String shortVersion = VersionUtil.getShortVersion(rootProject); File dir = rootProject.file("build/libs"); if (!dir.isDirectory()) { @@ -56,11 +52,11 @@ public class UploadTask extends DefaultTask { } } - CosUtil.writeAndUploadObject("latest.json", latest); + CosUtil.writeAndUploadObject(filename, latest); return latest; } - public void uploadDetail(CslLatest latest) throws IOException { + public void uploadDetail(CslLatest latest, String filename) throws IOException { CslDetail detail = new CslDetail(latest.version); rootProject.getAllprojects().stream() @@ -74,19 +70,33 @@ public class UploadTask extends DefaultTask { }); detail.sortDetails(); - CosUtil.writeAndUploadObject("detail.json", detail); + CosUtil.writeAndUploadObject(filename, detail); + } + + private void uploadBase(String latestJsonName, String detailJsonName) throws IOException, TencentCloudSDKException { + if (System.getenv("COS_SECRET_KEY") == null) { + return; + } + CslLatest latest = uploadArtifacts(latestJsonName); + if (latest == null) { + return; + } + uploadDetail(latest, detailJsonName); + CdnUtil.updateCdn(latestJsonName, detailJsonName); } @TaskAction public void upload() throws IOException, TencentCloudSDKException { - if (System.getenv("COS_SECRET_KEY") == null) { - return; - } - CslLatest latest = uploadArtifacts(); - if (latest == null) { - return; - } - uploadDetail(latest); - CdnUtil.updateCdn("latest.json", "detail.json"); + uploadBase("latest.json","detail.json"); + } + + @TaskAction + public void uploadBeta() throws IOException, TencentCloudSDKException { + uploadBase("latest-beta.json","detail-beta.json"); + } + + @TaskAction + public void uploadCanary() throws IOException, TencentCloudSDKException { + uploadBase("latest-canary.json","detail-canary.json"); } }