Getting the mod version from the gradle.properties
file
#100
-
Hi! Is there a way to replace all the version number instances with the version specified in the - uses: Kir-Antipov/[email protected]
with:
modrinth-id: P9DbqD2L
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-tag: mc1.20.2-VERSION
github-prerelease: true
github-token: ${{ secrets._GITHUB_TOKEN }}
name: Redstonery Mod VERSION for Minecraft 1.20.2
version: mc1.20.2-VERSION
version-type: alpha
changelog-file: CHANGELOG.md
loaders: |
fabric
game-versions: |
1.20.2 This would be probably an extra step before this one that reads the version and puts it in a variable? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I apologize for the delayed response. I've been busy working on lots of projects, including this one. First of all, I recommend checking out default values for different inputs, as there's a lot of unnecessary duplication in your config:
Also, I do not recommend using a custom GitHub token for that. Just use the regular After these changes, your configuration should look something like this: - uses: Kir-Antipov/[email protected]
with:
name: Redstonery Mod VERSION for Minecraft MC_VERSION
version: mcMC_VERSION-VERSION
version-type: alpha
changelog-file: CHANGELOG.md
modrinth-id: P9DbqD2L # Can be moved to fabric.mod.json too
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }} Since you create releases via manual workflow dispatches and/or pushes to the However, you are correct that you can use - name: Read properties from gradle.properties
id: read_properties
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: minecraft_version mod_version
- name: Upload assets to GitHub and Modrinth
uses: Kir-Antipov/[email protected]
with:
name: Redstonery Mod ${{ steps.read_properties.outputs.mod_version }} for Minecraft ${{ steps.read_properties.outputs.minecraft_version }}
version: mc${{ steps.read_properties.outputs.minecraft_version }}-${{ steps.read_properties.outputs.mod_version }}
version-type: alpha
changelog-file: CHANGELOG.md
modrinth-id: P9DbqD2L
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }} This way, Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Thank you very much |
Beta Was this translation helpful? Give feedback.
I apologize for the delayed response. I've been busy working on lots of projects, including this one.
First of all, I recommend checking out default values for different inputs, as there's a lot of unnecessary duplication in your config:
loaders
input. Its value is already inferred bymc-publish
since you are publishing a Fabric mod.game-versions
. They are inferred fromfabric.mod.json
.github-tag
as long as its value is exactly the same as theversion
's.github-prerelease
as long as its value correlates with theversion-type
's (as it is in your case).Also, I do not recommen…