diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b8820842..f486e3ebc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,23 @@ name: publish npm packages +# on: +# push: +# branches: +# - main + on: - push: - branches: - - main + pull_request: env: FORCE_COLOR: "1" jobs: publish: - environment: Production - runs-on: ubuntu-latest + # environment: Production + runs-on: ledgerhq-shared-medium + permissions: + id-token: write + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 @@ -21,11 +28,29 @@ jobs: - name: build libraries run: pnpm build - - - name: publish + + - name: Create Release Pull Request or Publish to npm + id: changesets uses: changesets/action@v1 with: - publish: pnpm release + branch: INFRAPRJ-6604 env: - GITHUB_TOKEN: ${{ github.token }} - NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} + + - name: Login to JFrog Ledger + if: steps.changesets.outputs.hasChangesets == 'false' + id: jfrog-login + uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1 + + - name: Publish to JFrog Ledger + if: steps.changesets.outputs.hasChangesets == 'false' + env: + # Change it to prod when test done + NPM_REGISTRY: jfrog.ledgerlabs.net/artifactory/api/npm/ldk-npm-sandbox-green + NPM_REGISTRY_TOKEN: ${{ steps.jfrog-login.outputs.oidc-token }} + run: | + cat << EOF | tee .npmrc + registry=https://${NPM_REGISTRY}/ + //${NPM_REGISTRY}/:_authToken=${NPM_REGISTRY_TOKEN} + EOF + pnpm publish --no-git-checks \ No newline at end of file diff --git a/package.json b/package.json index e5b4fd58d..7435cc6c8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "@ledgerhq/device-sdk", "version": "1.0.0", - "private": true, "license": "MIT", "scripts": { "build": "turbo run build",