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
| # Minecraft Mod 编译的 GitHub Actions 配置 | |
| name: Minecraft Web Script CI | |
| on: | |
| push: | |
| branches: [ "main", "dev" ] | |
| pull_request: | |
| branches: [ "main", "dev" ] | |
| jobs: | |
| build: | |
| # 使用最新的Ubuntu系统 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| # 1. 检出代码仓库 | |
| - uses: actions/checkout@v6 | |
| # 如果你使用了git子模块(比如Fabric API),需要添加这行 | |
| with: | |
| submodules: true | |
| # 2. 设置环境 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '25' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| # 3. 开始编译 | |
| - name: Build versioned artifacts with Task | |
| shell: bash | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm run build | |
| # 4. 上传油猴脚本 | |
| - name: Upload Monkey | |
| id: upload-monkey | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MC-Teamviewer-mod-web-script | |
| path: dist/*.js | |
| if-no-files-found: error | |