1.20.6-1.2.3 [RELEASE] #15
Workflow file for this run
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: Build and Publish Release | |
| on: | |
| release: | |
| types: [ published ] | |
| env: | |
| MODID: "additionalredstone" | |
| CURSEFORGE_ID: 455373 | |
| CURSEFORGE_LINK: "https://www.curseforge.com/minecraft/mc-mods/additional-redstone" | |
| MODRINTH_ID: "hhraLneG" | |
| MODRINTH_LINK: "https://modrinth.com/mod/additional-redstone" | |
| MODRINTH_FEATURED: false # if this version should be featured on modrinth | |
| DISCORD_COLOR: 16711680 | |
| DISCORD_MENTION: "<@&890143567421530162>" | |
| DISCORD_TITLE: "New version for AdditionalRedstone released :exclamation:" | |
| DISCORD_THUMBNAIL: "https://cdn.modrinth.com/data/hhraLneG/b7fd70f056843b480ce15f03bd5522405aafba28_96.webp" | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| java-version: ${{ steps.properties.outputs.java_version }} | |
| mc-version: ${{ steps.properties.outputs.minecraft_version }} | |
| mod-version: ${{ steps.properties.outputs.mod_version }} | |
| version-range: ${{ steps.properties.outputs.version_range }} | |
| steps: | |
| - name: Checkout Sourcecode | |
| uses: actions/checkout@v4 | |
| - name: calculate versions | |
| id: properties | |
| uses: christian-draeger/[email protected] | |
| with: | |
| path: 'gradle.properties' | |
| properties: 'minecraft_version mod_version version_range java_version' | |
| - name: Changelog | |
| shell: bash | |
| run: | | |
| echo "# Changelog ${{ steps.properties.outputs.minecraft_version }} - ${{ steps.properties.outputs.mod_version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "${{ github.event.release.body }}" >> $GITHUB_STEP_SUMMARY | |
| build-and-release: | |
| needs: prepare | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Sourcecode | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: ${{ needs.prepare.outputs.java-version }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-disabled: true | |
| - name: make gradle wrapper executable | |
| run: chmod +x ./gradlew | |
| - name: Execute Gradle build | |
| run: ./gradlew build | |
| - name: Add files to GitHub-Release | |
| uses: shogo82148/[email protected] | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: | | |
| ./forge/build/libs/${{ env.MODID }}-*.jar | |
| ./fabric/build/libs/${{ env.MODID }}-*.jar | |
| ./neoforge/build/libs/${{ env.MODID }}-*.jar | |
| overwrite: true | |
| - name: publish mod files | |
| uses: tristankechlo/[email protected] | |
| if: ${{ contains(github.event.release.name, '[RELEASE]') }} | |
| with: | |
| mc-version: ${{ needs.prepare.outputs.mc-version }} | |
| mod-version: ${{ needs.prepare.outputs.mod-version }} | |
| curseforge-id: ${{ env.CURSEFORGE_ID }} | |
| modrinth-id: ${{ env.MODRINTH_ID }} | |
| changelog: ${{ github.event.release.body }} | |
| loaders: forge,fabric,neoforge | |
| version-range: ${{ needs.prepare.outputs.version-range }} | |
| curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
| modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
| send-discord-embed: | |
| needs: [ "prepare", "build-and-release" ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Make embed | |
| uses: tristankechlo/[email protected] | |
| with: | |
| released: ${{ contains(github.event.release.name, '[RELEASE]') }} | |
| changelog: "${{ github.event.release.body }}" | |
| version: "${{ needs.prepare.outputs.mc-version }} - ${{ needs.prepare.outputs.mod-version }}" | |
| color: ${{ env.DISCORD_COLOR }} | |
| content: "${{ contains(github.event.release.name, '[RELEASE]') && env.DISCORD_MENTION || ''}}" | |
| title: ${{ env.DISCORD_TITLE }} | |
| description: "${{ contains(github.event.release.name, '[RELEASE]') && 'The update is available for *Forge*, *Fabric* and *NeoForge*' || 'The update will *not* be released to Curseforge or Modrinth'}}" | |
| curseforge: ${{ env.CURSEFORGE_LINK }} | |
| modrinth: ${{ env.MODRINTH_LINK }} | |
| github: ${{ github.event.release.html_url }} | |
| thumbnail: ${{ env.DISCORD_THUMBNAIL }} | |
| - name: Send Discord Message | |
| uses: tsickert/[email protected] | |
| with: | |
| webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| raw-data: ./embed.json |