11# For syntax, see https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
22# This workflow is triggered manually on the "Actions" tab on GitHub, and can be used to create releases.
33
4- name : Make a GDExtension build for all supported platforms
4+ name : Make and publish a GDExtension build for all supported platforms
55on :
66 workflow_dispatch :
7+ inputs :
8+ tag_name :
9+ description : " tag_name"
10+ required : true
11+ default : " tag_name"
12+ release_name :
13+ description : " release_name"
14+ required : true
15+ default : " release_name"
16+ asset_id :
17+ description : " The id of the asset in the asset store."
18+ required : true
19+ default : " asset_id"
20+
21+ permissions :
22+ contents : write
723
824jobs :
925 build :
88104 with :
89105 name : godot-cpp-template-${{ matrix.target.platform }}-${{ matrix.target.arch }}-${{ matrix.float-precision }}-${{ matrix.target-type }}
90106 path : |
91- ${{ github.workspace }}/bin/**
107+ ${{ github.workspace }}/demo/ bin/**
92108
93109 # Merges all the build artifacts together into a single godot-cpp-template artifact.
94110 # If you comment out this step, all the builds will be uploaded individually.
@@ -102,3 +118,45 @@ jobs:
102118 name : godot-cpp-template
103119 pattern : godot-cpp-template-*
104120 delete-merged : true
121+
122+ # Create a GitHub release
123+ release :
124+ runs-on : ubuntu-22.04
125+ needs : merge
126+ steps :
127+ - name : Checkout
128+ uses : actions/checkout@v4
129+
130+ - name : Download merged artifact
131+ uses : actions/download-artifact@v4
132+ with :
133+ name : godot-cpp-template
134+ path : release/addons/godot-cpp-template/
135+
136+ - name : Create archive
137+ shell : bash
138+ run : |
139+ sudo apt-get update && sudo apt-get install -y zip
140+ cd release && zip -r ../godot-cpp-template.zip .
141+
142+ - name : Create GitHub Release
143+ uses : softprops/action-gh-release@v2
144+ with :
145+ token : ${{ secrets.GITHUB_TOKEN }}
146+ tag_name : ${{ github.event.inputs.tag_name }}
147+ name : ${{ github.event.inputs.release_name }}
148+ body_path : CHANGELOG.md
149+ make_latest : true
150+ files : godot-cpp-template.zip
151+
152+ publish :
153+ runs-on : ubuntu-22.04
154+ needs : release
155+ steps :
156+ - name : Publish new version to asset lib
157+ uses : deep-entertainment/godot-asset-lib-action@v0.4.0
158+ with :
159+ # https://docs.github.com/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets
160+ username : ${{ secrets.ASSET_STORE_USERNAME }}
161+ password : ${{ secrets.ASSET_STORE_PASSWORD }}
162+ assetId : ${{ github.event.inputs.asset_id }}
0 commit comments