User Tools

Site Tools


zh_cn:tutorial:publishing_mods_using_github_actions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

zh_cn:tutorial:publishing_mods_using_github_actions [2023/02/17 14:36] – created solidblockzh_cn:tutorial:publishing_mods_using_github_actions [2023/02/17 14:44] (current) solidblock
Line 1: Line 1:
 ====== 使用 MC-Publish 将模组发布到 Curseforge、Modrinth 和 Github ====== ====== 使用 MC-Publish 将模组发布到 Curseforge、Modrinth 和 Github ======
  
-:!: 本页翻译自 [[tutorial:publishing_mods_using_github_actions]],如有过时的地方可参考原文。+:!: **本页翻译自 [[tutorial:publishing_mods_using_github_actions]],如有过时的地方可参考原文。**
  
 MC-Publish 是一个 GitHub action,由 Kir-Antipov 制作,可以在 GitHub、CurseForge 和 Modrinth API 中交互,以上传您的模组文件。本页面会大致描述基本的设置过程,你需要 [[https://github.com/Kir-Antipov/mc-publish#publish-minecraft-mods---github-action|阅读 GitHub 文档以了解详细信息。]] MC-Publish 是一个 GitHub action,由 Kir-Antipov 制作,可以在 GitHub、CurseForge 和 Modrinth API 中交互,以上传您的模组文件。本页面会大致描述基本的设置过程,你需要 [[https://github.com/Kir-Antipov/mc-publish#publish-minecraft-mods---github-action|阅读 GitHub 文档以了解详细信息。]]
Line 155: Line 155:
 ''CURSEFORGE_TOKEN''、''MODRINTH_TOKEN'' 和 ''GITHUB_TOKEN'' 本质上是用来验证你自己的密码,这意味着对应了你的账号,而不是你的模组。这可以确保只有你能通过 API 来推送更新。当你正常上传的时候,你会在登录的时候验证自己。在哪里找到这些令牌呢?每个平台有不同的步骤: ''CURSEFORGE_TOKEN''、''MODRINTH_TOKEN'' 和 ''GITHUB_TOKEN'' 本质上是用来验证你自己的密码,这意味着对应了你的账号,而不是你的模组。这可以确保只有你能通过 API 来推送更新。当你正常上传的时候,你会在登录的时候验证自己。在哪里找到这些令牌呢?每个平台有不同的步骤:
  
-**//Github//** Settings > Developer Settings > Personal access tokens > Tokens (classic) => 按 "Generate new token" and choose classic => select the 'repo' scope (write a descriptive note, 90 days expiration is recommended, you will need to generate a new token afterwards) => 按"Generate token"+**//Github//** Settings > Developer Settings > Personal access tokens > Tokens (classic) => 按 "Generate new token" and choose classic => select the 'repo' scope (write a descriptive note, 90 days 
 +expiration is recommended, you will need to generate a new token afterwards) => 按"Generate token"
  
 **//Modrinth//** Settings => Authorization token  **//Modrinth//** Settings => Authorization token 
Line 236: Line 237:
 </code> </code>
  
-===== Setup Complete =====+===== 设置完成 =====
  
-To recap, here is what you should have by now: +回顾一下,这是您现在应该拥有的: 
-  * Newly generated authentication tokens for every platform  +  * Wie每个平台新生成的验证令牌 
-  * Authentication tokens stored as secrets in your github repository +  * 验证令牌存储在你的 GitHub 存储库的 secrets  
-  * ''.yml'' file in ''/.github/workflows'' pushed to your github repository +  * 在 ''/.github/workflows'' 的一个 ''.yml'' 文件,并推送到你的 GitHub 存储库中 
-  * a empty ''CHANGELOG.md'' file in your project root+  * 你的项目根目录中的空白 ''CHANGELOG.md'' 文件
  
-If you have all these you are finished! You can now use your newly created Github Action to deploy updates for your mod!+如果你拥有所有这些,你就完成了!您现在可以使用新创建的 Github Action 为您的模组部署更新!
  
-===== Additional tips =====+===== 额外步骤 =====
  
-Here is a list of useful resources that didn't fit into the general tutorial.+以下是不适合一般教程的有用资源列表。
  
-==== Update Checklist ==== +==== 更新检查列表 ==== 
-When updating your mod you now have a few places you need to look at. +更新你的模组时,你需要看看的几个地方。 
-  * update the version number +  * 更新版本号 
-     in ''src/fabric.mod.json'' under ''"version": "1.1.0+1.19.2"'' +     在 ''src/fabric.mod.json'',中,在 ''"version": "1.1.0+1.19.2"'' 
-     in ''gradle.properties'' (typically) under ''mod_version = 1.1.0+1.19.2'' +     在 ''gradle.properties''(通常情况),在 ''mod_version = 1.1.0+1.19.2'' 
-     in ''.github/workflows/publish.yml'' under ''VERSION: 1.1.0+1.19.2'' and ''RELEASE_NAME: Example Mod 1.1.0 for Minecraft 1.19.2'' +     在 ''.github/workflows/publish.yml'' 在 ''VERSION: 1.1.0+1.19.2'' 和 ''RELEASE_NAME: 用于 Minecraft 1.19.2 的示例模组 1.1.0'' 
-  * update the changelog in ''CHANGELOG.md'' +  * 更新 ''CHANGELOG.md'' 中的更新记录 
-  * (if you use the recommended workflow) Merge the update branch into the current default branch+  * (如果你使用推荐的工作流程)将更新分支合并到当前默认分支
  
  
-==== Handling dependencies ====+==== 处理依赖 ====
  
-[[https://github.com/Kir-Antipov/mc-publish#dependencies|Check out the official documentation]]. I recommend using the ''fabric.mod.json'' approach. +[[https://github.com/Kir-Antipov/mc-publish#dependencies|请检查官方文档]]。我建议使用 ''fabric.mod.json'' 方法。
  
-==== Errors when uploading to Modrinth ====+==== 上传到 Modrinth 的错误 ====
  
-Since Modrinth updated its API some people have problems uploading through the API. If that happens to you, try separating the modrinth portion from Github and Curseforge. You can do this easily by copying the MC-Publish step and trimming out the now unecessary input in ''with''. You should now have two separate steps.+由于 Modrinth 更新了 API,一些人可能在通过这些 API 上传时会遇到问题,这种情况下可以将 modrinth 的部分从 GitHub 和 Curseforge 分开。你可以复制 MC-Publish 步骤并删除 ''with'' 中的现在不必要的输入部分来轻松完成此操作。你现在应该有两个独立的步骤。
  
-Change the version in the step that publishes to modrinth to 2.1 -> ''uses: Kir-Antipov/mc-publish@v2.1''+将发布到 modrinth 的步骤的版本更改为 2.1 -> ''uses: Kir-Antipov/mc-publish@v2.1''
  
  
zh_cn/tutorial/publishing_mods_using_github_actions.1676644582.txt.gz · Last modified: 2023/02/17 14:36 by solidblock