Skip to content

Commit 6b67d33

Browse files
update workflow
1 parent 24b7bd7 commit 6b67d33

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/build-mcpb.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ name: "Build MCPB Bundle"
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag/Release to upload the MCPB bundle to (e.g., 1.0.0)'
8+
required: false
9+
type: string
510
push:
611
tags:
7-
- 'v*'
12+
- '*'
13+
release:
14+
types: [published]
815

916
permissions:
1017
contents: write
@@ -46,7 +53,7 @@ jobs:
4653
- name: "Get version from package.json"
4754
id: get_version
4855
run: |
49-
VERSION="v$(node -p 'require("./package.json").version')"
56+
VERSION="$(node -p 'require("./package.json").version')"
5057
echo "version=$VERSION" >> $GITHUB_OUTPUT
5158
5259
- name: "List generated files"
@@ -63,10 +70,11 @@ jobs:
6370
if-no-files-found: error
6471

6572
- name: "Upload MCPB to GitHub Release"
66-
if: startsWith(github.ref, 'refs/tags/')
73+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '')
6774
uses: softprops/action-gh-release@v1
6875
with:
6976
files: "*.mcpb"
7077
fail_on_unmatched_files: true
78+
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
7179
env:
7280
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)