tutorial:publishing_mods_using_github_actions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
publishing_mods_using_github_actions [2022/11/14 13:35] – xipit | tutorial:publishing_mods_using_github_actions [2023/04/10 09:04] (current) – Fix typos and capitalisation poopooracoocoo | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Publishing | + | ====== Publishing |
- | MC-Publish is a Github | + | MC-Publish is a GitHub |
- | ===== What are Github | + | ===== What are GitHub |
- | [[https:// | + | [[https:// |
- | In Software Development Github Actions and similar workflow automation systems are standard place and help tremendously with making deployments (such as releasing a new version of your mod) as seemless | + | In Software Development Github Actions and similar workflow automation systems are standard place and help tremendously with making deployments (such as releasing a new version of your mod) as seamless |
- | If you dread the manual process of uploading your mod to multiple platforms this is the solution. | + | If you dread the manual process of uploading your mod to multiple platforms, this is the solution. |
Line 14: | Line 14: | ||
You should have already done the following: | You should have already done the following: | ||
- | - create a repository of your mod on Github | + | - create a repository of your mod on GitHub |
- | - upload a version of your mod to Curseforge | + | - upload a version of your mod to CurseForge |
===== Setup ===== | ===== Setup ===== | ||
- | If we want Github to do something for us, we need to tell their servers what exactly we want. To do that we need to add a '' | + | If we want Github to do something for us, we need to tell their servers what exactly we want. To do that we need to add a '' |
The general structure of your '' | The general structure of your '' | ||
<code yaml> | <code yaml> | ||
- | name: Publish on Github, Curseforge | + | name: Publish on GitHub, CurseForge |
- | on: [ pull_request, | + | on: [ pull_request, |
env: # | env: # | ||
Line 36: | Line 36: | ||
contents: write | contents: write | ||
- | jobs: #The place where you actually tell the Github | + | jobs: #The place where you actually tell the GitHub |
build: | build: | ||
runs-on: ubuntu-latest | runs-on: ubuntu-latest | ||
Line 43: | Line 43: | ||
</ | </ | ||
- | I recommend to keep '' | + | I recommend to keep '' |
Basic environments variables should include: | Basic environments variables should include: | ||
Line 80: | Line 80: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
* '' | * '' | ||
Line 123: | Line 123: | ||
=== MC-Publish === | === MC-Publish === | ||
- | This section will by its nature not be complete, to get a full overview you can [[https:// | + | This section will by its nature not be complete, to get a full overview you can [[https:// |
<code yaml> | <code yaml> | ||
Line 132: | Line 132: | ||
... | ... | ||
| | ||
- | - name: Publish (CurseForge/ | + | - name: Publish (CurseForge/ |
- | uses: Kir-Antipov/ | + | uses: Kir-Antipov/ |
with: | with: | ||
- | curseforge-id: | + | curseforge-id: |
curseforge-token: | curseforge-token: | ||
| | ||
Line 156: | Line 156: | ||
'' | '' | ||
- | **//Github//** Settings > Developer Settings > Personal access tokens > Tokens (classic) => press " | + | **//GitHub//** Settings > Developer Settings > Personal access tokens > Tokens (classic) => press " |
**// | **// | ||
- | **//Curseforge//** Settings > My API Tokens => choose a descriptive name and press " | + | **//CurseForge//** Settings > My API Tokens => choose a descriptive name and press " |
- | It is **strongly recommended** that you save the authentication tokens somewhere safe, e.g. a password manager. **Github | + | It is **strongly recommended** that you save the authentication tokens somewhere safe, e.g. a password manager. **GitHub |
- | Now that you have all the tokens you need, you have to make them accessible to your Github | + | Now that you have all the tokens you need, you have to make them accessible to your GitHub |
<code yaml> | <code yaml> | ||
${{ secrets.PUBLISH_CURSEFORGE_TOKEN }} | ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }} | ||
Line 173: | Line 173: | ||
==== Full .yml example ==== | ==== Full .yml example ==== | ||
<code yaml> | <code yaml> | ||
- | name: Publish on Github, Curseforge | + | name: Publish on GitHub, CurseForge |
on: [ pull_request, | on: [ pull_request, | ||
Line 214: | Line 214: | ||
run: ./gradlew clean build | run: ./gradlew clean build | ||
| | ||
- | - name: Publish (CurseForge/ | + | - name: Publish (CurseForge/ |
uses: Kir-Antipov/ | uses: Kir-Antipov/ | ||
with: | with: | ||
Line 240: | Line 240: | ||
To recap, here is what you should have by now: | To recap, here is what you should have by now: | ||
* Newly generated authentication tokens for every platform | * Newly generated authentication tokens for every platform | ||
- | * Authentication tokens stored as secrets in your github | + | * Authentication tokens stored as secrets in your GitHub |
* a '' | * a '' | ||
- | * a empty '' | + | * a empty '' |
- | If you have all these you are finished! You can now use your newly created | + | If you have all these you are finished! You can now use your newly created |
===== Additional tips ===== | ===== 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 '' | ||
+ | * in '' | ||
+ | * in '' | ||
+ | * update the changelog in '' | ||
+ | * (if you use the recommended workflow) Merge the update branch into the current default branch | ||
+ | |||
+ | |||
+ | ==== Handling dependencies ==== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ==== Errors when uploading to 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 unnecessary input in '' | ||
+ | |||
+ | Change the version in the step that publishes to modrinth to 2.1 -> '' | ||
tutorial/publishing_mods_using_github_actions.txt · Last modified: 2023/04/10 09:04 by poopooracoocoo