1- name : Build, Test, and Deliver Client
1+ name : " Build and Test Client"
22
33env :
44 do_sonarscan : >-
1111 push :
1212 branches :
1313 - main
14- - release/[0-9]+.[0-9]+.[0-9]+
15- release :
16- types :
17- - created
14+ - " release/**"
1815jobs :
1916 ccc :
2017 runs-on : ubuntu-latest
@@ -231,94 +228,6 @@ jobs:
231228 js-ref : ${{ github.ref }} latest lts
232229 platform-ref : main lts
233230
234- deliver-ghp :
235- needs :
236- - lib
237- - cli
238- - web-app
239- - scripts
240- - platform-xtest
241- runs-on : ubuntu-latest
242- timeout-minutes : 5
243- # To publish from a release or feature branch, remove the ref == condition below
244- if : >-
245- (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
246- (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')) ||
247- (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/'))
248- outputs :
249- FULL_VERSION : ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
250- DIST_TAG : ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
251- TARGET_VERSION : ${{ steps.check-version.outputs.TARGET_VERSION }}
252- steps :
253- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
254- - uses : actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
255- with :
256- node-version : ' 22'
257- registry-url : https://npm.pkg.github.com
258- - name : Check version number is same between tag, library, and/or release
259- id : check-version
260- run : |-
261- if [[ ${{ github.ref }} = refs/heads/release/* ]]; then
262- scripts/check-version-is.sh "${GITHUB_REF##*release/}"
263- elif [[ ${{ github.ref }} = refs/tags/sdk/v* ]]; then
264- scripts/check-version-is.sh "${GITHUB_REF_NAME#sdk/v}"
265- else
266- scripts/check-version-is.sh
267- fi
268- - name : Check version number is same between tag, library, and/or release
269- id : guess-build-metadata
270- run : |-
271- echo "FULL_VERSION=$(.github/workflows/gh-semver.sh)" >> $GITHUB_OUTPUT
272- echo "DIST_TAG=$(.github/workflows/guess-dist-tag.sh)" >> $GITHUB_OUTPUT
273- - run : make doc
274- - run : >-
275- echo "::notice file=lib/package.json::Will be published to
276- [GitHub Packages](https://github.com/opentdf/web-sdk/pkgs/npm/client)
277- as ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
278- with version=[${{ steps.guess-build-metadata.outputs.FULL_VERSION }}]"
279- - run : >-
280- .github/workflows/publish-to.sh
281- "${{ steps.guess-build-metadata.outputs.FULL_VERSION }}"
282- "${{ steps.guess-build-metadata.outputs.DIST_TAG }}"
283- env:
284- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
285- - run : echo "- [Client Library](https://github.com/opentdf/web-sdk/pkgs/npm/client)">>$GITHUB_STEP_SUMMARY
286- - run : echo "- [Command Line Tool](https://github.com/opentdf/web-sdk/pkgs/npm/cli)">>$GITHUB_STEP_SUMMARY
287- - name : Publish documentation to gh-pages
288- uses : JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
289- with :
290- branch : gh-pages
291- folder : lib/dist/docs
292-
293- deliver-npmjs :
294- runs-on : ubuntu-latest
295- timeout-minutes : 5
296- environment : npmjs
297- needs : deliver-ghp
298- if : >-
299- (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
300- (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')) ||
301- (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/sdk/v'))
302- steps :
303- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
304- - uses : actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
305- with :
306- node-version : ' 22'
307- registry-url : ' https://registry.npmjs.org'
308- - run : make all
309- - run : >-
310- .github/workflows/publish-to.sh
311- "${{ needs.deliver-ghp.outputs.FULL_VERSION }}"
312- "${{ needs.deliver-ghp.outputs.DIST_TAG }}"
313- env:
314- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
315- - run : >-
316- echo "- [Client Library](https://www.npmjs.com/package/@opentdf/sdk/v/${{ needs.deliver-ghp.outputs.FULL_VERSION }})">>$GITHUB_STEP_SUMMARY
317- - run : >-
318- echo "- [Command Line Tool](https://www.npmjs.com/package/@opentdf/ctl/v/${{ needs.deliver-ghp.outputs.FULL_VERSION }})">>$GITHUB_STEP_SUMMARY
319- - run : >-
320- echo "- [unpkg](https://unpkg.com/browse/@opentdf/sdk@${{ needs.deliver-ghp.outputs.FULL_VERSION }})">>$GITHUB_STEP_SUMMARY
321-
322231 ci :
323232 needs :
324233 - lib
@@ -329,5 +238,14 @@ jobs:
329238 runs-on : ubuntu-22.04
330239 if : ${{ !cancelled() }}
331240 steps :
332- - if : contains(needs.*.result, 'failure')
333- run : echo "Failed due to ${{ contains(needs.*.result, 'failure') }}" && exit 1
241+
242+ - name : " All jobs succeeded"
243+ id : success
244+ if : ${{ contains(needs.*.result, 'success') }}
245+ run : |
246+ :
247+
248+ - name : " One or more jobs failed"
249+ if : ${{ contains(needs.*.result, 'failure') }}
250+ run : |
251+ exit 1
0 commit comments