From 16bea5179a89af26dd0bfb07c7d6b7d1efa3c54e Mon Sep 17 00:00:00 2001 From: Jeroen Claassens Date: Tue, 5 Mar 2024 19:17:22 +0100 Subject: [PATCH] chore(npm): publish rc version for prereleases (#528) * ci: publish rc version with rc dist-tags * refactor: use github.ref --- .github/workflows/cd.yml | 10 +++++++--- npm/git-cliff/package.json | 5 ++++- npm/package.json.tmpl | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7cedb4a..4dd587b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -249,7 +249,7 @@ jobs: cp "../target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin" cp ../README.md "${node_pkg}" cd "${node_pkg}" - npm publish --access public + npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Build Python wheels (linux) @@ -302,12 +302,16 @@ jobs: registry-url: "https://registry.npmjs.org" - name: Publish the package shell: bash + working-directory: npm/git-cliff run: | - cd npm/git-cliff yarn install yarn build cp ../../README.md . - npm publish --access public + if [ ${{ contains(github.ref, '-') }} = "true" ]; then + yarn npm publish --tag rc + else + yarn npm publish + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} YARN_ENABLE_IMMUTABLE_INSTALLS: false diff --git a/npm/git-cliff/package.json b/npm/git-cliff/package.json index d3d41da..c7ec7ad 100644 --- a/npm/git-cliff/package.json +++ b/npm/git-cliff/package.json @@ -106,5 +106,8 @@ ], "root": true }, - "packageManager": "yarn@4.1.0" + "packageManager": "yarn@4.1.0", + "publishConfig": { + "access": "public" + } } diff --git a/npm/package.json.tmpl b/npm/package.json.tmpl index f26a263..60543f6 100644 --- a/npm/package.json.tmpl +++ b/npm/package.json.tmpl @@ -51,5 +51,8 @@ ], "cpu": [ "${node_arch}" - ] + ], + "publishConfig": { + "access": "public" + } }