Skip to content

Commit

Permalink
Create directory for modpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehver committed Jun 6, 2024
1 parent 29bf8e0 commit df0e465
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 7 deletions.
36 changes: 30 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,28 @@ jobs:
REPO_NAME_LOWER=$(echo $REPO_NAME | tr '[:upper:]' '[:lower:]')
RELEASE_TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
RELEASE_TAG_LOWER=$(echo $RELEASE_TAG | tr '[:upper:]' '[:lower:]')
TEMP_DIR="client-version-pkg_${REPO_NAME_LOWER}_${RELEASE_TAG_LOWER}"
TEMP_DIR="client-versionpack_${REPO_NAME_LOWER}_${RELEASE_TAG_LOWER}"
TEMP_MOD_DIR="client-modpack_${REPO_NAME_LOWER}_${RELEASE_TAG_LOWER}"
echo "::set-output name=repo_name::$REPO_NAME"
echo "::set-output name=repo_name_lower::$REPO_NAME_LOWER"
echo "::set-output name=release_tag::$RELEASE_TAG"
echo "::set-output name=release_tag_lower::$RELEASE_TAG_LOWER"
echo "::set-output name=temp_dir::$TEMP_DIR"
echo "::set-output name=temp_mod_dir::$TEMP_MOD_DIR"
- name: Create temporary directory
- name: Create temporary directory for version package
run: mkdir ${{ steps.vars.outputs.temp_dir }}

- name: Copy minecraft_client to temporary directory
run: cp -r minecraft_client ${{ steps.vars.outputs.temp_dir }}/${{ steps.vars.outputs.repo_name }}
- name: Copy minecraft_client_versionpack to temporary directory
run: cp -r minecraft_client_versionpack ${{ steps.vars.outputs.temp_dir }}/${{ steps.vars.outputs.repo_name }}

- name: Zip the directory
- name: Zip the directory for version package
run: |
cd ${{ steps.vars.outputs.temp_dir }}
zip -r ../${{ steps.vars.outputs.temp_dir }}.zip .
cd ..
- name: Upload zip to release
- name: Upload version package zip to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
Expand All @@ -132,6 +134,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Create temporary directory for modpack
run: mkdir ${{ steps.vars.outputs.temp_mod_dir }}

- name: Copy minecraft_client_modpack to temporary directory for modpack
run: cp -r minecraft_client_modpack/* ${{ steps.vars.outputs.temp_mod_dir }}

- name: Zip the directory for modpack
run: |
cd ${{ steps.vars.outputs.temp_mod_dir }}
zip -r ../${{ steps.vars.outputs.temp_mod_dir }}.zip .
cd ..
- name: Upload modpack zip to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.vars.outputs.temp_mod_dir }}.zip
asset_name: ${{ steps.vars.outputs.temp_mod_dir }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

handle-file-uploads:
runs-on: ubuntu-latest

Expand Down
16 changes: 16 additions & 0 deletions minecraft_client_modpack/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 玩家指南 For Players

如果要使用此 Modpack,你不应该解压此文件夹。请直接在支持 Curseforge Modpack 的启动器中导入此 Modpack。

If you want to use this Modpack, you should not extract this folder. Please import this Modpack directly in the launcher that supports Curseforge Modpack.

# For GitHub Users

这是 Curseforge 的 Modpack 目录。最低要求只有 `manifest.json`。其他文件,如 `overrides` 文件夹,也可以包含在内。

This is the modpack dir for Curseforge. Minimal requirements are only `manifest.json`. Other files like `overrides` folder may be included.

如果客户端没有特殊需要,可以关闭客户端打包的 Action Workflow 并删除此文件夹。

If the client has no special needs, you can disable the client packaging Action Workflow and delete this folder.

39 changes: 39 additions & 0 deletions minecraft_client_modpack/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"minecraft": {
"version": "1.19.4",
"modLoaders": [
{
"id": "fabric-0.14.21",
"primary": true
}
]
},
"manifestType": "minecraftModpack",
"manifestVersion": 1,
"name": "1.19.4-OPDModCarpet",
"version": "",
"author": "",
"files": [
{
"projectID": 397510,
"fileID": 4441719,
"required": true
},
{
"projectID": 306612,
"fileID": 4622860,
"required": true
},
{
"projectID": 349239,
"fileID": 4437137,
"required": true
},
{
"projectID": 406323,
"fileID": 3879398,
"required": true
}
],
"overrides": "overrides"
}
6 changes: 6 additions & 0 deletions minecraft_client_modpack/modlist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<ul>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/carpet-tis-addition">Carpet TIS Addition (by Fallen_Breath)</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/fabric-api">Fabric API (by modmuss50)</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/carpet">Carpet (by gnembon)</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/servux">Servux (by masady)</a></li>
</ul>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"url": "https://piston-data.mojang.com/v1/objects/73c8bb982e420b33aad9632b482608c5c33e2d13/server.txt"
}
},
"id": "1.19.4-Fabric 0.14.21",
"id": "1.19.4-OPDModCarpet",
"javaVersion": {
"component": "java-runtime-gamma",
"majorVersion": 17
Expand Down
19 changes: 19 additions & 0 deletions minecraft_client_versionpack/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 玩家指南 For Players

当你下载并解压此文件夹,将其放入 `.minecraft/versions` 文件夹中,然后在启动器中选择这个版本,即可开始游戏。

When you download and extract this folder, put it into `.minecraft/versions` folder, then select this version in the launcher, you can start the game.

请确保你的启动器支持版本选择功能和自动下载补全依赖。并且确保放入`.minecraft/versions`中的文件夹名字与此目录中 jar 文件的文件名一致。例如如果此处的 jar 文件名为 `1.19.4-Fabric.jar`,那么你的文件夹名也应该是 `1.19.4-Fabric`,最终效果是 `.minecraft/versions/1.19.4-Fabric/1.19.4-Fabric.jar`。

Please make sure your launcher supports version selection and automatic download of dependencies. And make sure the folder name in `.minecraft/versions` is the same as the jar file name in this directory. For example, if the jar file name here is `1.19.4-Fabric.jar`, then your folder name should also be `1.19.4-Fabric`, the final effect is `.minecraft/versions/1.19.4-Fabric/1.19.4-Fabric.jar`.

# For GitHub Users

这是 Minecraft 客户端的版本目录。最低要求只有 `<repo_name>.jar` 和 `<repo_name>.json`。其他文件,如 `mods` 文件夹,也可以包含在内。

This is the version dir for Minecraft Client. Minimal requirements are only `<repo_name>.jar` and `<repo_name>.json`. Other files like `mods` folder may be included.

如果客户端没有特殊需要,可以关闭客户端打包的 Action Workflow 并删除此文件夹。

If the client has no special needs, you can disable the client packaging Action Workflow and delete this folder.

0 comments on commit df0e465

Please sign in to comment.