mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-25 20:24:22 +00:00
Add: upload beta to cos
This commit is contained in:
1 parent
0b000731b5
commit
264aacc8c0
5 files changed
+74
-29
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
@@ -32,5 +32,5 @@ jobs:
|
||||
-
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-build
|
||||
name: CustomSkinLoader-Beta-${{ GITHUB_RUN_NUMBER }}
|
||||
path: build/libs
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user