Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Convert resources #8518

Convert resources

Convert resources #8518

Workflow file for this run

name: Convert resources
on:
pull_request:
branches: [main]
push:
branches: [main]
paths:
- '.github/workflows/convert.yml'
- 'c.sh'
schedule:
# 每一小时更新一次
- cron: '0 */1 * * *'
repository_dispatch:
types: [update_resources]
jobs:
convert_resources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install jq & set time
shell: bash
run: |
sudo apt install jq
jq --version
sudo timedatectl set-timezone 'Asia/Shanghai'
- name: check for updates
id: check_updata
shell: bash
run: |
echo '======================= 环境变量设置 ========================='
export "dLINK=https://zkitefly.github.io/TranslationPackMirror/files$dLINK"
echo '========================== 检查区 ==========================='
rm index.txt
wget --no-dns-cache --random-wait -d -T 60 -t 30 -O index.txt "$dLINK"
if md5sum -c --quiet 'md5.txt'; then
# No changes
echo 'changed=false' >> $GITHUB_OUTPUT
else
# Changes detected
echo 'changed=true' >> $GITHUB_OUTPUT
md5sum index.txt > md5.txt
fi
echo '=============================================================='
- name: download resources
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
echo '======================= 环境变量设置 ========================='
export "dLINK=https://zkitefly.github.io/TranslationPackMirror/files$dLINK"
# 此处要填写以下工作流的 "dNAME"
# Convert resources 1.12.2 -> 1.9/1.10 1.6/1.7/1.8
export "dNAME0=Minecraft-Mod-Language-Modpack.zip$dNAME0"
# Convert resources 1.16 -> 1.17 1.15 1.13/1.14
export "dNAME2=Minecraft-Mod-Language-Modpack-1-16.zip$dNAME2"
# Convert resources 1.16-Fabric -> 1.17-Fabric 1.15-Fabric
export "dNAME4=Minecraft-Mod-Language-Modpack-1-16-Fabric.zip$dNAME4"
# Convert resources 1.18-Fabric -> 1.17-Fabric 1.15-Fabric
export "dNAME4=Minecraft-Mod-Language-Modpack-1-18-Fabric.zip$dNAME3"
echo '========================== 检查区 ==========================='
wget --no-dns-cache --random-wait -d -T 60 -t 30 -O "$dNAME0" "$dLINK/$dNAME0"
wget --no-dns-cache --random-wait -d -T 60 -t 30 -O "$dNAME2" "$dLINK/$dNAME2"
wget --no-dns-cache --random-wait -d -T 60 -t 30 -O "$dNAME4" "$dLINK/$dNAME3"
wget --no-dns-cache --random-wait -d -T 60 -t 30 -O "$dNAME4" "$dLINK/$dNAME4"
echo '=============================================================='
# https://minecraft.fandom.com/zh/wiki/%E8%B5%84%E6%BA%90%E5%8C%85#%E5%86%85%E5%AE%B9
- name: Convert resources 1.16 -> 1.13/1.14
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack-1-16.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-16T1-13o4.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=4$cV"
# 校验文件名字,带 .md5
export "mNAME=1.16t1.13o4.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.16 to 1.13/1.14$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.12.2 -> 1.9/1.10
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-12-2T1-9o10.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=2$cV"
# 校验文件名字,带 .md5
export "mNAME=1.12.2t1.9o10.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.12.2 to 1.9/1.10$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.12.2 -> 1.6/1.7/1.8
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-12-2T1-6o7o8.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=1$cV"
# 校验文件名字,带 .md5
export "mNAME=1.12.2t1.6o7o8.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.12 to 1.6/1.7/1.8$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.16 -> 1.17
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack-1-16.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-16T1-17.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=7$cV"
# 校验文件名字,带 .md5
export "mNAME=1.16t1.17.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.16 -> 1.17$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.18-Fabric -> 1.19.3-Fabric
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack-1-18-Fabric.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-18-FabricT1-19-3-Fabric.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=12$cV"
# 校验文件名字,带 .md5
export "mNAME=1.18-fabrict1.19.3-fabric.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.18-Fabric to 1.19.3-Fabric$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.16-Fabric -> 1.17-Fabric
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack-1-16-Fabric.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-16-FabricT1-17-Fabric.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=7$cV"
# 校验文件名字,带 .md5
export "mNAME=1.16-fabrict1.17-fabric.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.16-Fabric -> 1.17-Fabric$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.16-Fabric -> 1.15-Fabric
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack-1-16-Fabric.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-16-FabricT1-15-Fabric.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=5$cV"
# 校验文件名字,带 .md5
export "mNAME=1.16-fabrict1.15-fabric.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.16-Fabric -> 1.15-Fabric$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Convert resources 1.16 -> 1.15
if: steps.check_updata.outputs.changed == 'true'
shell: bash
run: |
# 转换
echo '======================= 环境变量设置 ========================='
# 下载文件的名字,带 .zip
export "dNAME=Minecraft-Mod-Language-Modpack-1-16.zip$dNAME"
# 转换的名字,带 .zip
export "cNAME=Minecraft-Mod-Language-Modpack-1-16T1-15.zip$cNAME"
# 修改资源包 pack_format 的 value
export "cV=5$cV"
# 校验文件名字,带 .md5
export "mNAME=1.16t1.15.md5$mNAME"
# commit 标题名称,Convert resources + XXX
export "CM=1.16 -> 1.15$CM"
echo '======================= 运行修改脚本 ========================='
echo "========================== 预览 ============================="
cat "c.sh"
echo "============================================================"
./c.sh
echo '============================================================'
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Convert resources $CM(`date '+%Y-%m-%d %H:%M:%S'`)$GITHUB_RUN_ID
GitHub Action: https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID
"
- name: Push changes
if: steps.check_updata.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}