Publish on GitHub, CurseForge & Modrinth #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish on GitHub, CurseForge & Modrinth | |
| on: [ workflow_dispatch ] | |
| env: | |
| MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }} | |
| CURSEFORGE_TOKEN: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Environment Variables | |
| run: env | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Read gradle.properties | |
| uses: BrycensRanch/read-properties-action@v1.0.4 | |
| id: props | |
| with: | |
| file: gradle.properties | |
| all: true | |
| - name: Format versions for matrix | |
| id: versions | |
| run: | | |
| echo "GAME_VERSIONS<<EOF" >> $GITHUB_OUTPUT | |
| echo "${{ steps.props.outputs.additional_supported_mc_versions }}" | tr ',' '\n' >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Print versions | |
| run: | | |
| echo "Formatted versions:" | |
| echo "${{ steps.versions.outputs.GAME_VERSIONS }}" | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: "temurin" | |
| java-version: 25 | |
| - name: Make Gradle Wrapper Executable | |
| if: ${{ runner.os != 'Windows' }} | |
| run: chmod +x ./gradlew | |
| - name: Build | |
| run: ./gradlew clean build | |
| - name: Publish (CurseForge/Modrinth/GitHub) | |
| uses: Kir-Antipov/mc-publish@v3.3 | |
| with: | |
| curseforge-id: 956372 | |
| curseforge-token: "${{env.CURSEFORGE_TOKEN}}" | |
| modrinth-id: JL35Xbzz | |
| modrinth-token: "${{env.MODRINTH_TOKEN}}" | |
| modrinth-featured: false | |
| modrinth-unfeature-mode: none | |
| name: "OneWorldFolder ${{ steps.props.outputs.mod_version }}" | |
| version: "${{ steps.props.outputs.mod_version }}" | |
| version-type: release | |
| changelog-file: CHANGELOG.md | |
| loaders: fabric | |
| game-versions: | | |
| ${{ steps.props.outputs.minecraft_version }} | |
| ${{ steps.versions.outputs.GAME_VERSIONS }} | |
| java: "25" | |