@@ -9,13 +9,13 @@ inputs:
99 description : ' The npm tag to publish with (e.g., latest, preview, nightly).'
1010 required : true
1111 wombat-token-core :
12- description : ' The npm token for the @google/gemini- cli-core package.'
12+ description : ' The npm token for the cli-core package.'
1313 required : true
1414 wombat-token-cli :
15- description : ' The npm token for the @google/gemini- cli package.'
15+ description : ' The npm token for the cli package.'
1616 required : true
1717 wombat-token-a2a-server :
18- description : ' The npm token for the @google/gemini-cli- a2a-server package.'
18+ description : ' The npm token for the a2a package.'
1919 required : true
2020 github-token :
2121 description : ' The GitHub token for creating the release.'
@@ -51,10 +51,24 @@ inputs:
5151 gemini_api_key :
5252 description : ' The API key for running integration tests.'
5353 required : true
54- registry :
55- description : ' The registry to publish to.'
56- required : false
57- default : ' npm-wombat'
54+ npm-registry-publish-url :
55+ description : ' npm registry publish url'
56+ required : true
57+ npm-registry-url :
58+ description : ' npm registry url'
59+ required : true
60+ npm-registry-scope :
61+ description : ' npm registry scope'
62+ required : true
63+ cli-package-name :
64+ description : ' The name of the cli package.'
65+ required : true
66+ core-package-name :
67+ description : ' The name of the core package.'
68+ required : true
69+ a2a-package-name :
70+ description : ' The name of the a2a package.'
71+ required : true
5872runs :
5973 using : ' composite'
6074 steps :
@@ -117,126 +131,125 @@ runs:
117131 run : |
118132 npm run bundle
119133
134+ # TODO: Refactor this github specific publishing script to be generalized based upon inputs.
120135 - name : ' 📦 Prepare for GitHub release'
121- if : " inputs.registry == 'github'"
136+ if : " inputs.npm- registry-url == 'https://npm.pkg. github.com/ '"
122137 working-directory : ' ${{ inputs.working-directory }}'
123138 shell : ' bash'
124139 run : |
125140 node ${{ github.workspace }}/scripts/prepare-github-release.js
126141
127142 - name : ' Configure npm for publishing to npm'
128- if : " inputs.registry != 'github'"
129143 uses : ' actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
130144 with :
131145 node-version-file : ' ${{ inputs.working-directory }}/.nvmrc'
132- registry-url : ' https://wombat-dressing-room.appspot.com '
133- scope : ' @google '
146+ registry-url : ' ${{inputs.npm-registry-publish-url}} '
147+ scope : ' ${{inputs.npm-registry-scope}} '
134148
135- - name : ' Configure npm for publishing to GitHub '
136- if : " inputs.registry == ' github' "
137- uses : ' actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 '
149+ - name : ' Get core Token '
150+ uses : ' ./. github/actions/npm-auth-token '
151+ id : ' core-token '
138152 with :
139- node-version-file : ' ${{ inputs.working-directory }}/.nvmrc'
140- registry-url : ' https://npm.pkg.github.com'
141- scope : ' @google-gemini'
142-
143- - name : ' 📦 Publish @google/gemini-cli-core to npm'
144- if : " inputs.registry != 'github'"
145- working-directory : ' ${{ inputs.working-directory }}'
146- env :
147- NODE_AUTH_TOKEN : ' ${{ inputs.wombat-token-core }}'
148- shell : ' bash'
149- run : |
150- if [ "${{ inputs.dry-run }}" == "true" ]; then
151- npm publish --dry-run --workspace="@google/gemini-cli-core" --no-tag
152- else
153- npm publish --workspace="@google/gemini-cli-core" --no-tag
154- fi
153+ package-name : ' ${{ inputs.core-package-name }}'
154+ github-token : ' ${{ inputs.github-token }}'
155+ wombat-token-core : ' ${{ inputs.wombat-token-core }}'
156+ wombat-token-cli : ' ${{ inputs.wombat-token-cli }}'
157+ wombat-token-a2a-server : ' ${{ inputs.wombat-token-a2a-server }}'
155158
156- - name : ' 📦 Publish @google-gemini/gemini-cli-core to GitHub'
157- if : " inputs.registry == 'github'"
159+ - name : ' 📦 Publish CORE to NPM'
158160 working-directory : ' ${{ inputs.working-directory }}'
159161 env :
160- NODE_AUTH_TOKEN : ' ${{ inputs.github -token }}'
162+ NODE_AUTH_TOKEN : ' ${{ steps.core-token.outputs.auth -token }}'
161163 shell : ' bash'
162164 run : |
163165 npm publish \
164166 --dry-run="${{ inputs.dry-run }}" \
165- --workspace="@google-gemini/gemini-cli-core " \
167+ --workspace="${{ inputs.core-package-name }} " \
166168 --no-tag
167169
168170 - name : ' 🔗 Install latest core package'
169171 working-directory : ' ${{ inputs.working-directory }}'
170- if : " ${{ inputs.dry-run != 'true' && inputs.registry != 'github' }}"
172+ if : " ${{ inputs.dry-run != 'true' }}"
171173 shell : ' bash'
172174 run : |
173- npm install "@google/gemini-cli-core @${{ inputs.release-version }}" \
174- --workspace="@google/gemini- cli" \
175- --workspace="@google/gemini-cli- a2a-server " \
175+ npm install "${{ inputs.core-package-name }} @${{ inputs.release-version }}" \
176+ --workspace="${{ inputs. cli-package-name }} " \
177+ --workspace="${{ inputs. a2a-package-name }} " \
176178 --save-exact
177179
178- - name : ' 📦 Publish @google/gemini-cli to npm'
179- if : " inputs.registry != 'github'"
180- working-directory : ' ${{ inputs.working-directory }}'
181- env :
182- NODE_AUTH_TOKEN : ' ${{ inputs.wombat-token-cli }}'
183- shell : ' bash'
184- run : |
185- if [ "${{ inputs.dry-run }}" == "true" ]; then
186- npm publish --dry-run --workspace="@google/gemini-cli" --no-tag
187- else
188- npm publish --workspace="@google/gemini-cli" --no-tag
189- fi
180+ - name : ' Get CLI Token'
181+ uses : ' ./.github/actions/npm-auth-token'
182+ id : ' cli-token'
183+ with :
184+ package-name : ' ${{ inputs.cli-package-name }}'
185+ github-token : ' ${{ inputs.github-token }}'
186+ wombat-token-core : ' ${{ inputs.wombat-token-core }}'
187+ wombat-token-cli : ' ${{ inputs.wombat-token-cli }}'
188+ wombat-token-a2a-server : ' ${{ inputs.wombat-token-a2a-server }}'
190189
191- - name : ' 📦 Publish @google-gemini/gemini-cli to GitHub'
192- if : " inputs.registry == 'github'"
190+ - name : ' 📦 Publish CLI'
193191 working-directory : ' ${{ inputs.working-directory }}'
194192 env :
195- NODE_AUTH_TOKEN : ' ${{ inputs.github -token }}'
193+ NODE_AUTH_TOKEN : ' ${{ steps.cli-token.outputs.auth -token }}'
196194 shell : ' bash'
197195 run : |
198196 npm publish \
199197 --dry-run="${{ inputs.dry-run }}" \
200- --workspace="@google-gemini/gemini-cli " \
198+ --workspace="${{ inputs.cli-package-name }} " \
201199 --no-tag
202200
203- - name : ' 📦 Publish @google/gemini-cli-a2a-server'
204- if : " inputs.registry != 'github'"
201+ - name : ' Get a2a-server Token'
202+ uses : ' ./.github/actions/npm-auth-token'
203+ id : ' a2a-token'
204+ with :
205+ package-name : ' ${{ inputs.a2a-package-name }}'
206+ github-token : ' ${{ inputs.github-token }}'
207+ wombat-token-core : ' ${{ inputs.wombat-token-core }}'
208+ wombat-token-cli : ' ${{ inputs.wombat-token-cli }}'
209+ wombat-token-a2a-server : ' ${{ inputs.wombat-token-a2a-server }}'
210+
211+ - name : ' 📦 Publish a2a'
205212 working-directory : ' ${{ inputs.working-directory }}'
206213 env :
207- NODE_AUTH_TOKEN : ' ${{ inputs.wombat -token-a2a-server }}'
214+ NODE_AUTH_TOKEN : ' ${{ steps.a2a -token.outputs.auth-token }}'
208215 shell : ' bash'
209216 # Tag staging for initial release
210217 run : |
211- if [ "${{ inputs.dry-run }}" == "true" ]; then
212- npm publish --dry-run --workspace="@google/gemini-cli-a2a-server" --no-tag
213- else
214- npm publish --workspace="@google/gemini-cli-a2a-server" --no-tag
215- fi
218+ npm publish \
219+ --dry-run="${{ inputs.dry-run }}" \
220+ --workspace="${{ inputs.a2a-package-name }}" \
221+ --no-TARGET_TAG
216222
217223 - name : ' 🔬 Verify NPM release by version'
218224 uses : ' ./.github/actions/verify-release'
219- if : " ${{ inputs.dry-run != 'true' && inputs.force-skip-tests != 'true' && inputs.registry != 'github' }}"
225+ if : " ${{ inputs.dry-run != 'true' && inputs.force-skip-tests != 'true' }}"
220226 with :
221- npm-package : ' @google/gemini- cli@${{ inputs.release-version }}'
227+ npm-package : ' ${{ inputs. cli-package-name }} @${{ inputs.release-version }}'
222228 expected-version : ' ${{ inputs.release-version }}'
223229 ref : ' ${{ steps.release_branch.outputs.BRANCH_NAME }}'
224230 gemini_api_key : ' ${{ inputs.gemini_api_key }}'
231+ github-token : ' ${{ inputs.github-token }}'
232+ npm-registry-url : ' ${{ inputs.npm-registry-url }}'
233+ npm-registry-scope : ' ${{ inputs.npm-registry-scope }}'
225234
226235 - name : ' 🏷️ Tag release'
227236 uses : ' ./.github/actions/tag-npm-release'
228- if : " ${{ inputs.dry-run != 'true' && inputs.registry != 'github' }}"
237+ if : " ${{ inputs.dry-run != 'true' }}"
229238 with :
230239 channel : ' ${{ inputs.npm-tag }}'
231240 version : ' ${{ inputs.release-version }}'
232241 dry-run : ' ${{ inputs.dry-run }}'
242+ github-token : ' ${{ inputs.github-token }}'
233243 wombat-token-core : ' ${{ inputs.wombat-token-core }}'
234244 wombat-token-cli : ' ${{ inputs.wombat-token-cli }}'
235245 wombat-token-a2a-server : ' ${{ inputs.wombat-token-a2a-server }}'
246+ cli-package-name : ' ${{ inputs.cli-package-name }}'
247+ core-package-name : ' ${{ inputs.core-package-name }}'
248+ a2a-package-name : ' ${{ inputs.a2a-package-name }}'
236249
237250 - name : ' 🎉 Create GitHub Release'
238251 working-directory : ' ${{ inputs.working-directory }}'
239- if : " ${{ inputs.dry-run != 'true' && inputs.skip-github-release != 'true' && inputs.npm-tag != 'dev' && inputs.registry != 'github' }}"
252+ if : " ${{ inputs.dry-run != 'true' && inputs.skip-github-release != 'true' && inputs.npm-tag != 'dev' && inputs.npm- registry-url != 'https://npm.pkg. github.com/ ' }}"
240253 env :
241254 GITHUB_TOKEN : ' ${{ inputs.github-token }}'
242255 shell : ' bash'
0 commit comments