File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,16 @@ name: "Build MCPB Bundle"
22
33on :
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
916permissions :
1017 contents : write
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 }}
You can’t perform that action at this time.
0 commit comments