-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.97 KB
/
release-mcpack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and Release MCPACK
on:
workflow_dispatch:
inputs:
tag_name:
description: "The tag name for the release"
required: true
default: "1.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 }}