|
1 | | -name: Build, Test, and Deliver Client |
2 | | - |
3 | | -env: |
4 | | - do_sonarscan: >- |
5 | | - ${{ (github.event_name == 'push' || |
6 | | - github.event.pull_request.head.repo.full_name == github.repository) && |
7 | | - github.actor != 'dependabot[bot]' }} |
| 1 | +name: "Build and Test Client" |
8 | 2 |
|
9 | 3 | on: |
10 | 4 | pull_request: |
@@ -231,94 +225,6 @@ jobs: |
231 | 225 | js-ref: ${{ github.ref }} latest lts |
232 | 226 | platform-ref: main lts |
233 | 227 |
|
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 | | -
|
322 | 228 | ci: |
323 | 229 | needs: |
324 | 230 | - lib |
|
0 commit comments