docs(wiki): fix vanilla recipes #61
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
| # This workflow will build the Mod with Gradle and cache/restore any dependencies to improve the workflow execution time | |
| # Note: cache writing only happens on the default branch but child branches do have read access to the default branch | |
| name: Build Dev Snapshot | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - '**/dev' | |
| permissions: | |
| contents: write | |
| jobs: | |
| check_if_should_build: | |
| name: Check if a build should be triggered | |
| runs-on: ubuntu-latest | |
| outputs: | |
| skip: ${{ steps.changelog.outputs.skipped }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/[email protected] | |
| - name: Get Minecraft Version | |
| id: gradle_properties | |
| uses: christian-draeger/[email protected] | |
| with: | |
| path: './gradle.properties' | |
| properties: 'minecraft_version' | |
| - name: Generate Conventional Changelog | |
| id: changelog | |
| uses: Elenterius/conventional-changelog-action@e291986df89d31b4088e31d407e34e8787da70c9 | |
| # forked gh-action: uses custom pre-release bump strategy | |
| with: | |
| preset: 'conventionalcommits' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| version-file: './gradle.properties' | |
| version-path: 'mod_semantic_version' | |
| tag-prefix: '${{ steps.gradle_properties.outputs.minecraft_version }}-v2.' | |
| release-count: 1 # limit changelog to the current snapshot | |
| skip-commit: true # do not commit version bump | |
| skip-tag: true # do not commit version tag | |
| pre-release: true | |
| pre-release-identifier: 'alpha' | |
| setup_oxipng: | |
| name: Install Oxipng | |
| needs: [ check_if_should_build ] | |
| if: needs.check_if_should_build.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cargo Install Oxipng | |
| uses: baptiste0928/[email protected] #provides cache-efficient Rust crates installation | |
| with: | |
| crate: oxipng | |
| env: | |
| CARGO_TERM_COLOR: always | |
| build_test: | |
| name: Gradle Build Test | |
| needs: [ check_if_should_build ] | |
| if: needs.check_if_should_build.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| - uses: actions/[email protected] | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle, Validate Wrapper and Enable Caching | |
| uses: gradle/actions/[email protected] | |
| with: | |
| cache-read-only: false | |
| - name: Test Asset Generation | |
| run: ./gradlew runData | |
| - name: Test Build | |
| run: ./gradlew build | |
| build_snapshot: | |
| name: Build Snapshot | |
| needs: [ build_test, setup_oxipng ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Oxipng | |
| uses: baptiste0928/[email protected] | |
| with: | |
| crate: oxipng | |
| env: | |
| CARGO_TERM_COLOR: always | |
| - name: Checkout Repository | |
| uses: actions/[email protected] | |
| - name: Get Short SHA | |
| run: echo "SNAPSHOT_SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV | |
| - name: Get Minecraft Version | |
| id: gradle_properties | |
| uses: christian-draeger/[email protected] | |
| with: | |
| path: './gradle.properties' | |
| properties: 'minecraft_version' | |
| - name: Generate Conventional Changelog | |
| id: changelog | |
| uses: Elenterius/conventional-changelog-action@e291986df89d31b4088e31d407e34e8787da70c9 | |
| # forked gh-action: uses custom pre-release bump strategy | |
| with: | |
| preset: 'conventionalcommits' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| version-file: './gradle.properties' | |
| version-path: 'mod_semantic_version' | |
| git-message: 'chore(pre-release): {version}' | |
| tag-prefix: '${{ steps.gradle_properties.outputs.minecraft_version }}-v2.' | |
| release-count: 2 # limit changelog to the current and previous snapshot | |
| pre-release: true | |
| pre-release-identifier: 'alpha' | |
| - name: Setup JDK 17 | |
| uses: actions/[email protected] | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/[email protected] | |
| with: | |
| cache-read-only: false | |
| - name: Generate Assets | |
| run: ./gradlew runData | |
| - name: Optimize PNG Assets | |
| run: | | |
| oxipng -o 3 -i 0 --strip safe -r ./src/*/resources/*.png | |
| oxipng -o 3 -i 0 --strip safe -r ./src/*/resources/assets/*/textures | |
| env: | |
| CARGO_TERM_COLOR: always | |
| - name: Build Artifact | |
| run: ./gradlew build | |
| - name: Remove slim jars | |
| run: rm -f build/libs/*-slim.jar | |
| - name: Upload Artifact | |
| id: artifact-upload | |
| uses: actions/[email protected] | |
| with: | |
| name: dev-build | |
| if-no-files-found: error | |
| retention-days: 30 | |
| path: build/libs/*.jar | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/[email protected] | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag_name: ${{ steps.changelog.outputs.tag }} | |
| body: ${{ steps.changelog.outputs.clean_changelog }} | |
| files: build/libs/*.jar | |
| prerelease: true | |
| - name: Notify Discord Server | |
| uses: sarisia/[email protected] | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| nodetail: true | |
| color: 0x088c7d | |
| username: "Maykr Bot" | |
| content: "<@&1098316788116246550>" | |
| title: ":package: New Biomancy Snapshot Available!" | |
| description: | | |
| ## Version: `${{ steps.changelog.outputs.tag }}` | |
| ## [View changelog and download on GitHub](${{ steps.create_release.outputs.url }}) | |
| Don't forget to give us feedback :pray: |