Skip to content

Latest commit

 

History

History
65 lines (57 loc) · 1.49 KB

README.md

File metadata and controls

65 lines (57 loc) · 1.49 KB

build-mc-project

A GitHub action that builds a Minecraft project using Dash.

Usage

  1. Create a compiler config that uses the rewriteForPackaging plugin instead of simpleRewrite:
{
	"plugins": [
		[
			"typeScript",
			{
				"inlineSourceMap": true
			}
		],
		"entityIdentifierAlias",
		"customEntityComponents",
		"customItemComponents",
		"customBlockComponents",
		"customCommands",
		"moLang",
		[
			"rewriteForPackaging",
			{
				"packName": "myProject",
				"format": "mctemplate" // Or "mcaddon"/"mcworld"
			}
		]
	]
}
  1. Create a file for your release workflow that looks like this:
name: 'build-project'

on:
    release:
        types:
            - created

jobs:
    build:
        runs-on: ubuntu-latest

        steps:
            - name: Checkout project
              uses: actions/checkout@v2
            - name: Building project
              uses: bridge-core/build-mc-project@main
              with:
                  project-name: MyProject
                  package-type: mctemplate
                  compiler-config: .bridge/compiler/build.json
            - name: Release
              uses: softprops/action-gh-release@v1
              if: startsWith(github.ref, 'refs/tags/')
              with:
                  files: MyProject.mctemplate
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1. Upon creating a new GitHub release, bridge. will now automatically build a new version of the project and attach it as a release artifact.