9191 node-version : 20
9292 registry-url : https://registry.npmjs.org
9393
94+ - name : Detect [release] in commit message
95+ id : commit_release
96+ if : github.event_name == 'push'
97+ run : |
98+ msg="$(git log -1 --format=%B)"
99+ is_release=false
100+ bump_type=""
101+ if echo "$msg" | grep -qiF '[release:major]'; then
102+ is_release=true
103+ bump_type=major
104+ elif echo "$msg" | grep -qiF '[release]'; then
105+ is_release=true
106+ bump_type=minor
107+ fi
108+ echo "is_release=$is_release" >> "$GITHUB_OUTPUT"
109+ echo "bump_type=$bump_type" >> "$GITHUB_OUTPUT"
110+
111+ - name : Bump versions ([release])
112+ if : steps.commit_release.outputs.is_release == 'true'
113+ run : node scripts/ci/bump-versions.js
114+ env :
115+ BUMP_TYPE : ${{ steps.commit_release.outputs.bump_type }}
116+
94117 - name : Verify workspace packages
95118 run : |
96119 for dir in packages/appwrite-utils packages/appwrite-utils-helpers packages/appwrite-utils-cli packages/appwrite-utils-mcp; do
@@ -125,31 +148,31 @@ jobs:
125148 run : bash scripts/ci/check-publish.sh packages/appwrite-utils appwrite-utils
126149 env :
127150 GITHUB_EVENT_BEFORE : ${{ github.event.before }}
128- FORCE_PUBLISH : ${{ steps.manual.outputs.force }}
151+ FORCE_PUBLISH : ${{ steps.commit_release.outputs.is_release == 'true' && 'true' || steps. manual.outputs.force }}
129152
130153 - name : Check appwrite-utils-helpers publish
131154 id : check_helpers
132155 if : github.event_name != 'workflow_dispatch' || steps.manual.outputs.packages == 'all' || contains(steps.manual.outputs.packages, 'appwrite-utils-helpers')
133156 run : bash scripts/ci/check-publish.sh packages/appwrite-utils-helpers appwrite-utils-helpers
134157 env :
135158 GITHUB_EVENT_BEFORE : ${{ github.event.before }}
136- FORCE_PUBLISH : ${{ steps.manual.outputs.force }}
159+ FORCE_PUBLISH : ${{ steps.commit_release.outputs.is_release == 'true' && 'true' || steps. manual.outputs.force }}
137160
138161 - name : Check appwrite-utils-cli publish
139162 id : check_cli
140163 if : github.event_name != 'workflow_dispatch' || steps.manual.outputs.packages == 'all' || contains(steps.manual.outputs.packages, 'appwrite-utils-cli')
141164 run : bash scripts/ci/check-publish.sh packages/appwrite-utils-cli appwrite-utils-cli
142165 env :
143166 GITHUB_EVENT_BEFORE : ${{ github.event.before }}
144- FORCE_PUBLISH : ${{ steps.manual.outputs.force }}
167+ FORCE_PUBLISH : ${{ steps.commit_release.outputs.is_release == 'true' && 'true' || steps. manual.outputs.force }}
145168
146169 - name : Check appwrite-utils-mcp publish
147170 id : check_mcp
148171 if : github.event_name != 'workflow_dispatch' || steps.manual.outputs.packages == 'all' || contains(steps.manual.outputs.packages, 'appwrite-utils-mcp')
149172 run : bash scripts/ci/check-publish.sh packages/appwrite-utils-mcp appwrite-utils-mcp
150173 env :
151174 GITHUB_EVENT_BEFORE : ${{ github.event.before }}
152- FORCE_PUBLISH : ${{ steps.manual.outputs.force }}
175+ FORCE_PUBLISH : ${{ steps.commit_release.outputs.is_release == 'true' && 'true' || steps. manual.outputs.force }}
153176
154177 - name : Build appwrite-utils
155178 if : github.event_name != 'workflow_dispatch' || steps.manual.outputs.packages == 'all' || contains(steps.manual.outputs.packages, 'appwrite-utils')
@@ -173,7 +196,7 @@ jobs:
173196 steps.check_helpers.outputs.should_publish == 'true' ||
174197 steps.check_cli.outputs.should_publish == 'true' ||
175198 steps.check_mcp.outputs.should_publish == 'true') &&
176- (github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
199+ (steps.commit_release.outputs.is_release == 'true' || github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
177200 run : |
178201 publish_packages=""
179202 if [[ "${{ steps.check_utils.outputs.should_publish }}" == "true" ]]; then
@@ -195,28 +218,28 @@ jobs:
195218 PUBLISH_PACKAGES="$publish_packages" node scripts/ci/prepare-publish.js
196219
197220 - name : Publish appwrite-utils-helpers
198- if : steps.check_helpers.outputs.should_publish == 'true' && (github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
221+ if : steps.check_helpers.outputs.should_publish == 'true' && (steps.commit_release.outputs.is_release == 'true' || github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
199222 run : npm publish --access public
200223 working-directory : packages/appwrite-utils-helpers
201224 env :
202225 NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
203226
204227 - name : Publish appwrite-utils
205- if : steps.check_utils.outputs.should_publish == 'true' && (github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
228+ if : steps.check_utils.outputs.should_publish == 'true' && (steps.commit_release.outputs.is_release == 'true' || github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
206229 run : npm publish --access public
207230 working-directory : packages/appwrite-utils
208231 env :
209232 NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
210233
211234 - name : Publish appwrite-utils-cli
212- if : steps.check_cli.outputs.should_publish == 'true' && (github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
235+ if : steps.check_cli.outputs.should_publish == 'true' && (steps.commit_release.outputs.is_release == 'true' || github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
213236 run : npm publish --access public
214237 working-directory : packages/appwrite-utils-cli
215238 env :
216239 NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
217240
218241 - name : Publish appwrite-utils-mcp
219- if : steps.check_mcp.outputs.should_publish == 'true' && (github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
242+ if : steps.check_mcp.outputs.should_publish == 'true' && (steps.commit_release.outputs.is_release == 'true' || github.event_name != 'workflow_dispatch' || steps.manual.outputs.publish == 'true')
220243 run : npm publish --access public
221244 working-directory : packages/appwrite-utils-mcp
222245 env :
0 commit comments