Skip to content

Build and Release MCPACK #9

Build and Release MCPACK

Build and Release MCPACK #9

name: Build and Release MCPACK
on:
workflow_dispatch:
inputs:
tag_name:
description: "The tag name for the release"
required: true
default: "v1.0.0"
type: string
release_message:
description: "The message for the release"
required: true
default: "Release message"
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
# リポジトリをチェックアウト
- name: Checkout code
uses: actions/checkout@v4
# 不要なファイルを除いてファイルをコピー
- name: Clean up unnecessary files
run: |
mkdir -p build
rsync -av --exclude='build' --exclude='.git/' --exclude='.github/' --exclude='.gitignore' --exclude='README.md' --exclude='package-lock.json' --exclude='package.json' --exclude='readme-en.md' --exclude='versions.json' ./ build/
# MCPACKファイルを生成 (ZIP圧縮)
- name: Create MCPACK
run: |
cd build
zip -r ../NoteBlockPlus.mcpack ./*
cd ..
# GitHubリリースにアップロード
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag_name }} # 手動で指定したタグ名
release_name: ${{ github.event.inputs.tag_name }}
draft: false
prerelease: false
body: ${{ github.event.inputs.release_message }} # 手動で指定したリリースメッセージ
# MCPACKをアップロード
- name: Upload MCPACK to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./NoteBlockPlus.mcpack
asset_name: NoteBlockPlus.mcpack
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}