Skip to content

chore: push to jfrog #17

chore: push to jfrog

chore: push to jfrog #17

Workflow file for this run

name: SLSA Generator Custom NodeJS
on:
workflow_dispatch:
push:
permissions:
contents: read
id-token: write
attestations: write
jobs:
build:
runs-on: public-ledgerhq-shared-small
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
- name: Build steps
run: |
echo "Building the project"
npm pack
- name: Get npm package filename
id: package-info
run: |
PACKAGE_PATH=$(ls -1 *.tgz | head -n 1) # To be change with the action as input
pack_json=$(npm pack $PACKAGE_PATH --json | tee pack.json | jq -c)
jq <pack.json
PACKAGE_FILENAME=$(echo "$pack_json" | jq -r '.[0].filename')
echo "PACKAGE_FILENAME=${PACKAGE_FILENAME}" >> $GITHUB_OUTPUT
- name: Login to JFrog Ledger
id: jfrog-login
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
- name: Configure npm authentication
run: |
echo "registry=https://jfrog.ledgerlabs.net/artifactory/api/npm/cybersec-npm-prd-public/" > .npmrc
echo "//jfrog.ledgerlabs.net/artifactory/api/npm/cybersec-npm-prd-public/:_authToken=${{ steps.jfrog-login.outputs.oidc-token }}" >> .npmrc
echo "//jfrog.ledgerlabs.net/artifactory/api/npm/cybersec-npm-prd-public/:always-auth=true" >> .npmrc
- name: Publish package to JFrog Ledger with npm
run: |
npm publish
- name: Attest for npmjs.com
uses: LedgerHQ/actions-security/actions/attest-for-npmsjs-com@feat-init-npmjs-com-action
with:
subject-path: ${{ steps.package-info.outputs.PACKAGE_FILENAME }}