Build and Release MCPACK #25
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
| 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 | |
| permissions: | |
| contents: write # リリース作成に必要な権限を明示的に設定 | |
| 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/ | |
| - name: Create MCPACK | |
| run: | | |
| cd build | |
| zip -r ../NoteBlockPlus.mcpack ./* | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag_name }} | |
| name: ${{ github.event.inputs.tag_name }} | |
| body: ${{ github.event.inputs.release_message }} | |
| draft: false | |
| prerelease: false | |
| files: NoteBlockPlus.mcpack | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |