sbom #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SBOM | |
| on: | |
| push: | |
| branches: | |
| - sbom-dev | |
| permissions: | |
| contents: read | |
| jobs: | |
| sbom: | |
| if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'sbom-dev' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get sources | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Test devextreme-schematics | |
| run: pnpm --filter devextreme-schematics run test | |
| - name: Build devextreme-schematics | |
| run: pnpm --filter devextreme-schematics run build | |
| - name: Pack packages | |
| shell: bash | |
| run: | | |
| mkdir -p artifacts | |
| package_cli_tgz="$(pnpm --filter devextreme-cli pack --json --pack-destination artifacts | jq -er '.filename')" | |
| package_schematics_tgz="$(pnpm --filter devextreme-schematics pack --json --pack-destination artifacts | jq -er '.filename')" | |
| echo "PACKAGE_CLI_TGZ=$package_cli_tgz" >> "$GITHUB_ENV" | |
| echo "PACKAGE_SCHEMATICS_TGZ=$package_schematics_tgz" >> "$GITHUB_ENV" | |
| sbom_packages="devextreme-cli(../../$package_cli_tgz),devextreme-schematics(../../$package_schematics_tgz)" | |
| echo "SBOM_PACKAGES=$sbom_packages" >> "$GITHUB_ENV" | |
| - name: Upload packages | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: packages | |
| path: artifacts/*.tgz | |
| if-no-files-found: error | |
| retention-days: 1 | |
| - name: Build SBOMs | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pnpm set //npm.pkg.github.com/:_authToken="$NODE_AUTH_TOKEN" | |
| cd tools/make-sbom && pnpm install --frozen-lockfile && pnpm run make-sbom-hashed | |
| - name: Upload SBOMs | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sbom | |
| path: tools/make-sbom/dist | |
| if-no-files-found: error | |
| retention-days: 1 | |