Compare commits

..
18 Commits
Author SHA1 Message Date
33 f8f3caad39 Fix: trigger release action by tag 2023-01-04 17:15:40 +08:00
33 bd409ae169 Tweak: trigger release action by tag 2023-01-04 17:11:43 +08:00
33 82f0aad9ff Release: 14.15 2023-01-04 16:37:33 +08:00
33 f2fce38137 Fix: pass secrets to reuse workflow 2023-01-04 16:27:28 +08:00
33 7d19f3114c Add: GitHub Action Test 2023-01-04 16:15:47 +08:00
33 d7a1e0f31f Update: certificate 2023-01-04 15:56:11 +08:00
33 201210f567 Fix: GitHub Action 2023-01-04 15:40:53 +08:00
33 26ed002689 Fix: GitHub Action 2023-01-04 15:39:55 +08:00
33 7d7e5c9060 Update: reuse GitHub Action workflow 2023-01-04 15:37:43 +08:00
33 81bf422250 Add: environment in GitHub Action 2023-01-04 15:12:17 +08:00
33 776e31e158 Fix: cos beta build upload 2023-01-04 14:50:30 +08:00
33 4a92223158 Fix: GitHub Action 2023-01-04 14:38:43 +08:00
33 264aacc8c0 Add: upload beta to cos 2023-01-04 14:34:46 +08:00
33 0b000731b5 Remove: Circle CI 2023-01-04 13:57:39 +08:00
33 f0012b58df Tweak: GitHub Action 2023-01-04 13:50:38 +08:00
33 013c22ae95 Add: GitHub Action 2023-01-04 13:43:08 +08:00
33 01d02a27b0 Update: circle ci version 2.1 2023-01-04 12:01:48 +08:00
33 077551e161 Tweak: only build release branch in circle ci 2023-01-04 12:01:48 +08:00
15 changed files with 179 additions and 82 deletions

No files matched your search

-45
View File
@@ -1,45 +0,0 @@
# Java Gradle CircleCI 2.0 configuration file
version: 2
jobs:
build:
docker:
- image: cimg/openjdk:8.0
working_directory: ~/repo
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
- restore_cache:
keys:
- gradle-cache
# Gradle Wrapper
- run:
name: Gradle Version
command: |
sudo chmod +x gradlew
./gradlew --version
- run:
name: Build
command: |
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $CIRCLE_SHA1)
./gradlew clean build
- run:
name: Publish
command: |
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $CIRCLE_SHA1)
./gradlew upload --debug --stacktrace
# ./gradlew publishGprPublicationToGitHubPackagesRepository
- store_artifacts:
path: ./build/libs
- save_cache:
paths:
- ~/.gradle
key: gradle-cache
+14
View File
@@ -0,0 +1,14 @@
name: Beta
on:
push:
branches:
- '14-develop'
jobs:
build-beta:
name: Build Beta
uses: xfl03/MCCustomSkinLoader/.github/workflows/common.yml@14-develop
with:
type: Beta
publish-task: uploadBeta
secrets: inherit
+14
View File
@@ -0,0 +1,14 @@
name: Canary
on:
push:
branches:
- '15-develop'
jobs:
build-canary:
name: Build Canary
uses: xfl03/MCCustomSkinLoader/.github/workflows/common.yml@15-develop
with:
type: Canary
publish-task: uploadCanary
secrets: inherit
+51
View File
@@ -0,0 +1,51 @@
name: Common
on:
workflow_call:
inputs:
type:
required: true
type: string
publish-task:
required: true
type: string
jobs:
build-common:
name: Build Common
runs-on: ubuntu-latest
environment: Build
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
env:
KEY_PASS: ${{ secrets.KEY_PASS }}
run: |
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA)
./gradlew clean build --stacktrace
-
name: Publish
env:
COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: |
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA)
./gradlew ${{ inputs.publish-task }} --info --stacktrace
# ./gradlew publishGprPublicationToGitHubPackagesRepository
-
uses: actions/upload-artifact@v3
with:
name: CustomSkinLoader-${{ inputs.type }}-${{ github.run_number }}
path: build/libs
+14
View File
@@ -0,0 +1,14 @@
name: Release
on:
push:
tags:
- '*'
jobs:
build-release:
name: Build Release
uses: xfl03/MCCustomSkinLoader/.github/workflows/common.yml@14-develop
with:
type: Release
publish-task: upload
secrets: inherit
@@ -27,7 +27,7 @@ import customskinloader.utils.MinecraftUtil;
/**
* Custom skin loader mod for Minecraft.
*
* @author (C) Jeremy Lam [JLChnToZ] 2013-2014 & Alexander Xia [xfl03] 2014-2020
* @author Jeremy Lam [JLChnToZ] 2013-2014 & Alexander Xia [xfl03] 2014-2023
* @version @MOD_FULL_VERSION@
*/
public class CustomSkinLoader {
@@ -198,8 +198,8 @@ public class CustomSkinLoader {
String credential = MinecraftUtil.getCredential(gameProfile);
//CustomSkinLoader needs username to load standard skin, if username not exist, only textures in NBT can be used
//Authlib 3.11.50 makes empty username to "\u0020"
if (username == null || username.isEmpty() || username.equals("\u0020") || credential == null) {
//Authlib 3.11.50 makes empty username to " "
if (username == null || username.isEmpty() || username.equals(" ") || credential == null) {
return dynamicSkullManager.getTexture(gameProfile);
}
if (config.forceUpdateSkull ? profileCache.isReady(credential) : profileCache.isExist(credential)) {
+18 -13
View File
@@ -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
@@ -78,26 +80,29 @@ You can also use 'ExtraList' which makes it easier for users to add your server
See [CONTRIBUTING.md](CONTRIBUTING.md)
## Copyright & LICENSE
### Major Contributor
- 2013-2014 Jeremy Lam([JLChnToZ](https://github.com/JLChnToZ))
- 2014-2023 Alexander Xia([xfl03](https://github.com/xfl03))
- 2020-2023 [ZekerZhayard](https://github.com/ZekerZhayard)
### Binary File
You could not modify binary file.
Feel free to use and share this mod and unmodified file in anyway like modpack.
When using in modpack, you must put 'CustomSkinLoader' in mod list.
You could not repost this mod to any website without permission.
You could not earn money with this mod excluding modpack.
### Source Code
#### Package 'customskinloader'
Including some codes from
- [AsteriskTeam/TabIconHackForge](http://git.oschina.net/AsteriskTeam/TabIconHackForge) (GPLv3)
- [RecursiveG/UniSkinMod](https://github.com/RecursiveG/UniSkinMod) (GPLv3)
- [NekoCaffeine/Alchemy](https://github.com/NekoCaffeine/Alchemy) (GPLv3)
Copyright © 2013-2014 Jeremy Lam "JLChnToZ".
Copyright © 2014-2019 Alexander Xia "xfl03".
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
```
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
```
GPLv3: http://www.gnu.org/licenses/gpl.html
You should change the name of the package to avoid others' misunderstanding.
+3 -3
View File
@@ -92,8 +92,8 @@ subprojects {
mcVersion : config.minecraft_version,
mcFullVersions : config.minecraft_full_versions,
forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL"),
gitVersion : System.getenv("CIRCLE_SHA1") ?: System.getenv("GITHUB_SHA"),
buildUrl : System.getenv("CIRCLE_BUILD_URL") ?: "https://github.com/xfl03/MCCustomSkinLoader/actions/runs/" + System.getenv("GITHUB_RUN_ID"),
releaseTime : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
@@ -133,7 +133,7 @@ subprojects {
}
task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf { System.getenv("KEY_PASS") != null }
onlyIf { System.getenv("KEY_PASS") != null && System.getenv("KEY_PASS") != "" }
doLast { System.out.println("Jar will be signed.") }
inputFile = jar.archivePath
+1 -1
View File
@@ -3,4 +3,4 @@ group=customskinloader
version=14.15
dev_version=
#RELEASE: snapshot=0
snapshot=1
snapshot=0
@@ -1,6 +1,8 @@
package customskinloader.gradle;
import customskinloader.gradle.task.UploadTask;
import customskinloader.gradle.task.UploadBetaTask;
import customskinloader.gradle.task.UploadCanaryTask;
import customskinloader.gradle.task.UploadReleaseTask;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
@@ -8,7 +10,11 @@ public class BuildPlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
System.out.printf("Apply project '%s'", project.getName());
project.getTasks().create("upload", UploadTask.class,
project.getTasks().create("upload", UploadReleaseTask.class,
task -> task.rootProject = project.getRootProject());
project.getTasks().create("uploadBeta", UploadBetaTask.class,
task -> task.rootProject = project.getRootProject());
project.getTasks().create("uploadCanary", UploadCanaryTask.class,
task -> task.rootProject = project.getRootProject());
}
}
@@ -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;
@@ -14,14 +12,11 @@ import customskinloader.gradle.util.CosUtil;
import customskinloader.gradle.util.VersionUtil;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.tasks.TaskAction;
public class UploadTask extends DefaultTask {
public abstract class UploadBaseTask 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 +51,11 @@ public class UploadTask extends DefaultTask {
}
}
CosUtil.writeAndUploadObject("latest.json", latest);
CosUtil.writeAndUploadObject(filename, latest);
return latest;
}
public void uploadDetail(CslLatest latest) throws IOException {
private void uploadDetail(CslLatest latest, String filename) throws IOException {
CslDetail detail = new CslDetail(latest.version);
rootProject.getAllprojects().stream()
@@ -74,19 +69,20 @@ public class UploadTask extends DefaultTask {
});
detail.sortDetails();
CosUtil.writeAndUploadObject("detail.json", detail);
CosUtil.writeAndUploadObject(filename, detail);
}
@TaskAction
public void upload() throws IOException, TencentCloudSDKException {
protected void uploadBase(String latestJsonName, String detailJsonName) throws IOException, TencentCloudSDKException {
System.out.printf("latestJsonName: %s, detailJsonName: %s\n", latestJsonName, detailJsonName);
if (System.getenv("COS_SECRET_KEY") == null) {
System.out.println("COS_SECRET_KEY not found.");
return;
}
CslLatest latest = uploadArtifacts();
CslLatest latest = uploadArtifacts(latestJsonName);
if (latest == null) {
return;
}
uploadDetail(latest);
CdnUtil.updateCdn("latest.json", "detail.json");
uploadDetail(latest, detailJsonName);
CdnUtil.updateCdn(latestJsonName, detailJsonName);
}
}
@@ -0,0 +1,13 @@
package customskinloader.gradle.task;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import org.gradle.api.tasks.TaskAction;
import java.io.IOException;
public class UploadBetaTask extends UploadBaseTask {
@TaskAction
public void uploadBeta() throws IOException, TencentCloudSDKException {
uploadBase("latest-beta.json", "detail-beta.json");
}
}
@@ -0,0 +1,13 @@
package customskinloader.gradle.task;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import org.gradle.api.tasks.TaskAction;
import java.io.IOException;
public class UploadCanaryTask extends UploadBaseTask {
@TaskAction
public void uploadCanary() throws IOException, TencentCloudSDKException {
uploadBase("latest-canary.json","detail-canary.json");
}
}
@@ -0,0 +1,13 @@
package customskinloader.gradle.task;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import org.gradle.api.tasks.TaskAction;
import java.io.IOException;
public class UploadReleaseTask extends UploadBaseTask{
@TaskAction
public void upload() throws IOException, TencentCloudSDKException {
uploadBase("latest.json","detail.json");
}
}
@@ -19,6 +19,9 @@ public class VersionUtil {
}
public static String getBuildNum() {
if (System.getenv("GITHUB_RUN_NUMBER") != null) {
return System.getenv("GITHUB_RUN_NUMBER");
}
if (System.getenv("CIRCLE_BUILD_NUM") != null) {
return System.getenv("CIRCLE_BUILD_NUM");
}